Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:41
    sf9v starred EngoEngine/engo
  • 02:38
    juanjoseamaker starred EngoEngine/engo
  • Jun 20 21:07
    cristian-tentella starred EngoEngine/engo
  • Jun 20 16:06
    zurgeg closed #775
  • Jun 20 16:06
    zurgeg commented #775
  • Jun 20 16:02
    zurgeg commented #775
  • Jun 20 16:01
  • Jun 20 15:55
    zurgeg reopened #775
  • Jun 20 15:55
    zurgeg commented #775
  • Jun 20 15:51
    zurgeg closed #775
  • Jun 20 15:21
    zurgeg commented #775
  • Jun 20 15:20
    zurgeg commented #775
  • Jun 20 15:18
    zurgeg commented #775
  • Jun 20 15:18
    zurgeg commented #775
  • Jun 20 14:53
    Noofbiz commented #775
  • Jun 20 14:52

    Noofbiz on master

    upgrade go module (#777) (compare)

  • Jun 20 14:52
    Noofbiz closed #777
  • Jun 20 13:17
    coveralls commented #777
  • Jun 20 13:12
    coveralls commented #777
  • Jun 20 13:10
    coveralls commented #777
Noofbiz
@Noofbiz
But if you need any help implementing anything, I'll be glad to help out as much as I can
Is it available on GitHub or somewhere I could see it in context?
Elliot Thomas
@eth0net
Does anyone have any recommendations for creating entities from textures also loaded in the TMX file? Currently considering the best approach as all the Tileset data is being parsed from the TMX already and I was thinking I could apply properties to identify the png tiles to use, but this is all discarded by the TMXLevel parser right now 🤔
Otherwise I’ll probably just handle it how I handled my character sprite, Ioaded the spritesheet in engo and passed it all to my character. I was kinda hoping for a more automatic solution in this case though, as it would be nice to create all of the map (maybe character sprites included) in Tiled and just enhance it in engo
The kind of entity I’m talking about in this case is a chest for example, next thing I’m working on is entity interaction so wanted to get a chest I can animate opening and interact with. The sprites for the chest are in one of the tilesets loaded in my map though
Noofbiz
@Noofbiz
The TMX value Properties should work for what you want. It's just a key/value pair you can put on anything, just do like a property that's a tag for it and when you're parsing it look for the property
Animation frames should be imported from Tiled as well, but you'll have to turn them into animation components and put them into the animation system. I haven't actually tried it myself though but it should work in theory lol
Daniel Ribeiro
@drgomesp
Does anybody know how I can apply a flip/mirror operation to a drawable? I'm currently doing a simple Scale(-1,1), but it happens to move the space component and the entity position becomes wrong
Noofbiz
@Noofbiz
The quickest way would be just adding to the position the width of the texture, but it also messes up positioning for things like walls and collisions so you'd have to adjust those for when the sprite us flipped as well
I'm wondering if we should do the adjustment on the render system side of things though, so it all still syncs up with the other systems without the end user having to do it
Like if it detects a negative scale it can readjust the position automatically
Noofbiz
@Noofbiz
No said that wrong, it won't change the position just draw it at the changed position location it won't change the space components
Elliot Thomas
@eth0net
It could be good to add it to the engine, since I doubt anyone would want to use the current effect :) I assume it's essentially sliding the end of the image back before the beginning of the image, along whichever axis the negative is on? So the original top left corner is in the correct place, but the rest of the image shifts around that
Noofbiz
@Noofbiz
It actually uses the same starting coordinate, but draws it backwards
So the top left corner of the original image is where it draws, but when the scale is negative it goes top-left instead of top-right
Elliot Thomas
@eth0net
Makes sense
Kind of what I was trying to get to, but I'm not always the most articulate lol
I do this to support unicode, maybe you have a better way
Noofbiz
@Noofbiz
Looks awesome! What license is that under, and do you mind if i integrate the text/font into common?
Kayon
@kayon
No problem. It's MIT license.
Mikhail Vitsen
@porfirion

Hi! I'm working on my own game and just searched for ECS implementations in go, because I feel like I did something wrong when invented/tried to implement ecs on go type system... But I see that you are using absolutely the same approach! Here is my code:

type HpAndStam struct {
    Hp, HpMax, HpRegen       int32
    Stam, StamMax, StamRegen int32
}

func (hs *HpAndStam) GetHpAndStam() *HpAndStam { return hs }

type IHpAndStam interface {
    GetHpAndStam() *HpAndStam
}

I've just came to ask: @Noofbiz don't you feel that this way is limiting possibilities of esc? Imagine if you write engine from scratch again - would you do the same? Just interesting how it feels at scale and should I continue with my research %)

Noofbiz
@Noofbiz
Hello! Thank you for your interest. I think when go 2 comes out I'll do a rewrite of how the ecs stuff works in engo. Without generics it's either a bunch of boilerplate (like the implementation of systems especially system/interface) or a lot of upfront work on the end user, like the library that was posted here a few weeks ago. So when generics become available I'd like to work on using that to have the world able to hold the entities and pass them to systems along with the Update function. This will help cut back on three work users have to do by simplifying the system interface, and allow things to behave like your usual ecs implementation
Noofbiz
@Noofbiz
@drgomesp #774 fixes this. The render system will now draw it where the space component is when a negative scale is used ^_^
James Rivett-Carnac
@yarbelk
high level question: if i want two cameras; say for minimap or multiple screens with different stuff (think, supreme commander); I'd need to rewrite the render system arround this concept the camera system would also need a rewrite, but not much as it seems a bit more abstract.
(getting ahead of myself: i'm actually working on a widget/layout system right now)
Noofbiz
@Noofbiz
I'm not sure you'd have to go quite that far. I think the easiest way to do it is use another shader, and limit that to only drawing in a specific area. One warning though, I haven't tried it so while it should work out, there could be some reason it doesn't in implementation lol
Ghost
@ghost~609fd8db6da03739847ca952
Question about rendering composed things: how would i render a rectangle with an image and text on top of it as a single entity?
James Rivett-Carnac
@yarbelk
re-asking above with the right account: Question about rendering composed things: how would i render a rectangle with an image and text on top of it as a single entity?
James Rivett-Carnac
@yarbelk
I suspect i need a new drawable and shader to do it correctly.
otherwise I should use multiple entities with a parent relationship i think.
James Rivett-Carnac
@yarbelk
if i go the second route: the their should be a system that reflows and resizes the entities based on relationships..
James Rivett-Carnac
@yarbelk
Ok; i think i'm close; but will rewrite it all because i have the wrong component shape and am handling dirty relflows badly. when done; i'll ask for feedback...
Elliot Thomas
@eth0net
Damn I missed a bit recently, been too busy with trying to change jobs to get to my Go fun times :(
I'm back and trying to push on now though lol
Sorry I can't help with text rendering stuff, haven't gotten to UI work yet
Maybe check out some example projects? I found some good references for other stuff before that use Engo, I'll see if I can dig up the list
Also, has anyone tried loading in TSX files? I'm getting errors with no loader, not a huge issue since I can just get Tiled to embed the TSX into the TMX files ^^ but yeah thought some work had been done on TSX recently, maybe I misunderstood xD
Noofbiz
@Noofbiz
TSX files should load automatically when the tmx files need them. There's no need to add it to the preload
Noofbiz
@Noofbiz
I think a reflowing/resizing system based on parent/child relationships could even be general enough to be in common
Elliot Thomas
@eth0net
Ohhh thanks I was thinking they needed to be loaded the same as the TMX, I’ll give that a go :)
Elliot Thomas
@eth0net
Okay so I tried it that way and got a different issues D: Maybe I have a slightly odd case I guess... I have my TMX files in assets/tilemaps/ and my TSX and PNGs in assets/tilesets/ which seems to be throwing off the root for the loader
It's loading the TSX files no problem, but then the TSX files reference "Grass.png" relative path and it tries to then load assets/tilemaps/Grass.png instead of assets/tilesets/Grass.png
Just looking to see if I can figure out the loaded to change the root temporarily for the TSX and back again for the TMX to continue - haven't looked into the loader code too much though so could do with a hand if anyone can help :)
Not a priority though since I can just embed TSX into TMX for the time being!
James Rivett-Carnac
@yarbelk

@Noofbiz yeah; I hope so. Hopefully my implementation isn't too insane.

I am having an issue though: in a test, when i engo.Mailbox.Dispatch(MoveWidgetMessage{...}), the Listener function is triggered twice; and i can't figure out why.

I can solve it by adding a *sync.Once on the message, but thats messy.

(I'm basically of two minds on how to achive things like moving etc.
1) message passing a la MoveWidgetMessage which moves that widget and all children
2) dirty flags and move the tree in Update.

each have their own confusions and issues: the Message one as above; and i don't know how its going to look if update is called in the middle of a move; or once i implement drag and drop stuff...

2) dirty need some sort of mechanism to trigger; and if you're moving something the 'ideal' mechanism if you're not using messages is to just container.SpaceComponent.Position.Add(), but... no dirty flag there.

I could make a MoveableComponent, or embed said component into the WidgetComponent since 'set offsets and reflow' is fundemental to a widget layout system; and then set all the flags on the WidgetComponent; so MoveVector, Dirty, update then finds trees with a Dirty and tries to apply all changes...

So the interface to moving a widget around would be setting WidgetCompoent.MoveVector or WidgetComponent.NewPosition to something and flagging it as Dirty; and the UISystem.Updatechanges it.

I'm partial to Command/Events due to my programming background, but

question

which interface (MoveVector, NewPosition) makes more sense? you could generalize either to Translation, NewSpaceComponent; so that doesn't bother me.

James Rivett-Carnac
@yarbelk
the message based/command (MoveVector) one would also probably be better for tracking movements of things... though why you would want that in a widget layout and UI system i have no idea.
James Rivett-Carnac
@yarbelk
@kayon your stuff is really cool
i was dreading the text stuff
(as a lover of LaTeX, i know just enough about typesetting to be terrified of it)
and the examples of canvas; though i have a data model for constructing reusable widgets from primatives; I may steal a lot of what you did.