Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Noofbiz
@Noofbiz
Like if it detects a negative scale it can readjust the position automatically
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.
jg3205
@jg3205:matrix.org
[m]
Hey, is there an automatic scrolling tool for Engo?
acaciocruz
@acaciocruz:matrix.org
[m]
Hi, quick question: I'm eval'ing ebiten, pixel and engo. I am making a 2D game (flat map), already done a prototype using SDL (veandco). It is not clear to me, based on the github docs, if the engine is targeted at 2D or 3D games. Anyone can chime in and give their opinion? thx
Rami Awar
@RamiAwar
Hello, has anyone built this on mac M1?
Getting an error
# golang.org/x/mobile/gl
In file included from ../../../go/pkg/mod/golang.org/x/mobile@v0.0.0-20200329125638-4c31acba0007/gl/work.go:29:
./work.h:18:10: fatal error: 'OpenGLES/ES2/glext.h' file not found
#include <OpenGLES/ES2/glext.h>
         ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
1 reply
molko
@molko824
im getting segfault when i try to add to rendersystem
    for _, system1 := range world.Systems() {
        switch sys := system1.(type) {
        case *common.RenderSystem:
            sys.Add(
                &system.BasicEntity,
                &system.RenderComponent,
                &system.SpaceComponent,
            )
        }
    }
1 reply
pankajkamble75
@pankajkamble75
Hello
Good Morning
Alex Houseago
@ahouseago

Hi, using the engo/ecs package, how would I model a system for targeting another entity to apply some damage? The components I think I need are an HP component (any entity with that can be damaged), an Attack component (any entity with that can damage another entity)?

I don't really understand from the package docs how to make a system that takes any entity with either HP or Attack components, only systems that take entities with both. Am I approaching this the right way? My game at the moment is not physics based so I'm not using collisions to calculate damage, just if one entity targets another it will deal some damage at a set interval.

wilsonsilva.eth
@wilsonsilva90_twitter
I just wanted to show my appreciation for this project. After struggling for a while with Ebiten, I decided to give this a go and everything seems great so far, even for a Go newbie like me.