No name Isometric RTS

  • Katala, inspite of that you have created a really great game already

    Really appreciate your dedication

  • Hello, I was checking out this demo as I'm struggling in creating a dimetric city building prototype.

    Basically (and probably because I suck at math), I can't get zoning to snap to the grid.

    I have a menu where I can choose which tile I want to build, the tile is spawned and "locked" to the mouse (set position to Mouse.X, Mouse.Y, plus an offset to center the tile).

    Then when I click again the tile stops following the mouse and is "dropped" in the field.

    Just for the sake of testing, I tried to make it snap to a 16x16 grid (grid and tiles were created as 64x64 - or better, 64x32 in a square image of 64x64).

    But, sucking at math, the best way I came out is something like:

    on "drop", set tile position to

    round(Self.X) + (round(Self.X) % 16)[/code:33z43alc] (and the same with Self.Y).
    
    While I was expecting that they didn't snap to the right position on the grid, it seems they don't snap to multiples of 16, not even adding a wait after the drop action.
    
    (I'm not on my dev PC right now, so I can't provide a .capx at the moment)
    
    Long story short: is there a tutorial around explaining how to deal with isometric/dimetric zoning, and/or could you provide a .capx with the events needed for that part to work?
    I would be immensely grateful, really!
  • Copons It depends how you handle te game logic. I only project objects from regular grid layer to isometric view. So what I do on building placement, I first project it from isometric view to normal grid layer, where actual game locig happens.

    mapX and mapY are values for map size on tiles.

    Set Building X To round((((mouse.X / 32 + mouse.Y / 16) / 2))-mapX/2)*64-32
    Set Building Y To round((((mouse.Y / 16 -(mouse.X / 32)) / 2))+mapY/2)*64+32[/code:9gxc3gd9]
    
    Then I project that building back to isometric layer same way as all other objects.
    [code:9gxc3gd9]Set IsoBuilding X To (LayoutWidth/2)+((building.X-building.Y)/64)*32+32
    Set IsoBuilding Y To ((building.X+building.Y)/64)*16[/code:9gxc3gd9]
    I use some offset corrections, but they should be just some last numbers I think.
    
    So I'm not sure how to snap directly to isometric view.
    
    Also I'm not great at math this just seemed to work  also if someone can come up with better formula it would be great.
    
    About this game there is some performance issues when I try to place unit weapons as separate Sprites to them. Even when I don't use this formula, but only setting their position to those isometric unit objects. Don't know if pin is any better. Could there be something else than for each, that I could use.
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Katala Thank you for the answer!

    Until now I was trying to do everything directly in isometric view, but I guess it's just too hard to handle.

    As soon as I get back home I'll give your method a try!

  • Copons I think that method should be good for city builder when you basically have to set that position only ones for buildings and you still have that easier space to work on the logic. If you are planning more of a simulator, I would guess the isometric projection is one of the easier things to do. It was discussed somewhere in the forums that if you are planning to make cars as "agents" something like in Simcity you don't necessarily have to calculate the paths again every time, but store the notes and then just use them and build sort of path node bank as the game progresses. Also if the cars aren't overlapping the buildings you would't necessarily have to constantly check the z order.

    Well maybe I'm getting a bit ahead of myself I just have thought about something like simcity before when the new one was what it was.

  • Katala I was thinking more about a super-light clone of Caesar-like games (basically for the same reasons as you: I've noticed a great lack of this genre in my Steam library ) than Sim City, with people spawning from house-buildings and going to work-buildings and back, but only able to walk on road tiles (so I guess I should recreate paths only when building something).

    But for now I'd be happy to have a sandbox-ish thing with buildings snapping to grid.

  • Neat. I'm getting Red Alert vibe. When you have more, let me know, and I can make you some killer soundtrack for it.

  • megatronx [quote:1znkqmg3]When you have more, let me know, and I can make you some killer soundtrack for it.

    Really? That would be great. C&C games are my main inspiration . However I think I'm going to mainly concentrate other, a bit more simpler game for a while. All my projects tend to get somewhat complicated. So it might be take some time.

    Also I know next to nothing about this Dune game, but the soundtrack is quite awesome.

    http://youtu.be/HJgdp4uhSbs?t=1h30m38s

  • megatronx [quote:1h1bayzn]When you have more, let me know, and I can make you some killer soundtrack for it.

    Really? That would be great. C&C games are my main inspiration . However I think I'm going to mainly concentrate other, a bit more simpler game for a while. All my projects tend to get somewhat complicated. So it might be take some time.

    Also I know next to nothing about this Dune game, but the soundtrack is quite awesome.

    http://youtu.be/HJgdp4uhSbs?t=1h30m38s

    Yeah, cool. I know Dune too. Yeah, I do complicated things too, that's why I first write what i need to do. There are some exceptions, like when I 100% know what I'm doing, but for new things I plan in advance on paper.

  • Looks great!

  • Katala

    I love RTS... i have one aswell in plan... but i have like 35 FPS playing with those 5 soldiers in your demo in FF !!??

    (my PC 3GHz quad xeon 8GB , SSD, GF660TI 2GB)

  • irina I'm planning to use Node-Webkit so FF is not concern. My FPS jumps a lot on FF.

    On ChromeI get constant 60 and about 7-10% CPU

    Intel i5-3570K 3.4GHz, 8GB RAM, GTX 560 Ti TOP 1GB

  • You are cool! I am trying to make isometric game now too and you have gave me hope for success:)

  • Altus , Very much possible good luck with that

  • VERY COOL!!!!!!!!!!!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)