No name Isometric RTS

Show us your works in progress and request feedback

Post » Tue Apr 08, 2014 4:31 pm

THIS LOOKS AWESOME!! I been exploring various features of Construct 2 since past one week. I too primarily want to create an isometric game. But was sad not to find any information regarding it. Looks like C2 does not have an inbuilt Isometric renderer/feature. I would love to see how you are draw those tiles and handling the Pathfinding, do you define polygons at the bottom of the building?

Also how do you handling the Z-order(layering) of floor/characters and buildings? Eg: You solider is perfectly walking infront and behind a building. How did you achieve that?
I hope you can write a short article on this. ... I am sure you will be an overnight HERO here!! :D
Create your own Isometric Runner Game using C2:

Image

Check out my game "Last of the Survivors":
Play Store
App Store
B
60
S
14
G
2
Posts: 427
Reputation: 5,564

Post » Tue Apr 08, 2014 5:48 pm

@SamRock Here is some good info about isometric projection. I also use this method
http://clintbellanger.net/articles/isometric_math/

You don't really need any special isometric renderer. The idea is that the actual game logic happens on separate invisible "regular grid" layer and the isometric objects are just drawn with certain formula from objects from that layer.

I also posted isometric tilemap example using two Tilemap objects here
https://www.scirra.com/forum/viewtopic.php?f=146&t=97423&p=747572&hilit=isometric+isometric+to+2+tilemaps#p747572

For Z order I but all Sprites that need to be sorted to Zorder family and then if something moves on screen or camera is moved I call the update using zorder global number. Not function because on my understanding that could call it many times per tick. Not completely sure though.

For the update you can use.
Code: Select all
For eagh Zorder.family (ordered) Zorder.family.Y ascending
=> move to Top


Also to for better performance I use every second for the update based on Zorder objects on screen something like
Code: Select all
every ZobjectOnScreen/500 seconds

Making the update every tick can be a bit much specially if you have one wall tile as single object. You notice this in my game if you train a lot of units it's not so perfect anymore :) Also note that on C2 version r166 there is some event engine performance improvements and this might be a bit faster as well. Just experiment with it and see what is acceptable.

I was thinking about making tutorial about this, but I would maybe like to add some other functionality as well. Maybe floors and hills, but then it would start to be almost some sort of isometric engine and quite a bit of work. Would be interesting though :)
B
34
S
9
G
3
Posts: 517
Reputation: 5,276

Post » Tue Apr 08, 2014 6:17 pm

@Katala Looking real good... would be lookign forward to a tutorial if you ever decide to make one ...an iso engine would be nice too :) ... glad to see you're using Blender. I used to be a max user when I found blender I stopped using max all together... plus its free you can't really compete with that.
Freefall Bird
B
47
S
9
G
5
Posts: 281
Reputation: 5,803

Post » Tue Apr 08, 2014 9:46 pm

Katala wrote: (Your very useful reply!!)


@Katala Thank you sooo much for the detailed explanation, your sample file gave me a good idea on how you are rendering the tiles. Till few mins ago, I was infact trying to rewrite the TileMap Plugin with a new name :D

But unfortunately I am not able to understand whats happening within it. Also Construct 2 seems to be looking for the name "TileMap" and wont load the TileMap.png file by default into the tile selector.

Few years ago, I wrote my own Isometric World editor on VB and C#. I stopped when it came to creating AI and pathfinding :(

BTW did you try creating a isometric TileMap using the C2 tilemap plugin? ;) I am not able to crack the Draw function.

Again thanks for the response and great example file... on to trying out C2 to the fullest :D
Create your own Isometric Runner Game using C2:

Image

Check out my game "Last of the Survivors":
Play Store
App Store
B
60
S
14
G
2
Posts: 427
Reputation: 5,564

Post » Wed Apr 09, 2014 7:53 am

@SamRock Do you mean did I try to edit the Tilemap plugin? Well I cannot really code.
B
34
S
9
G
3
Posts: 517
Reputation: 5,276

Post » Wed Apr 09, 2014 10:05 pm

@Katala, inspite of that you have created a really great game already :)
Really appreciate your dedication
Create your own Isometric Runner Game using C2:

Image

Check out my game "Last of the Survivors":
Play Store
App Store
B
60
S
14
G
2
Posts: 427
Reputation: 5,564

Post » Fri Apr 11, 2014 8:42 am

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
Code: Select all
round(Self.X) + (round(Self.X) % 16)
(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!
B
6
S
2
G
1
Posts: 6
Reputation: 513

Post » Fri Apr 11, 2014 11:30 am

@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.
Code: Select all
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


Then I project that building back to isometric layer same way as all other objects.
Code: Select all
Set IsoBuilding X To (LayoutWidth/2)+((building.X-building.Y)/64)*32+32
Set IsoBuilding Y To ((building.X+building.Y)/64)*16

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.
B
34
S
9
G
3
Posts: 517
Reputation: 5,276

Post » Fri Apr 11, 2014 12:16 pm

@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! :)
B
6
S
2
G
1
Posts: 6
Reputation: 513

Post » Fri Apr 11, 2014 1:26 pm

@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.
B
34
S
9
G
3
Posts: 517
Reputation: 5,276

PreviousNext

Return to Works in Progress/Feedback Requests

Who is online

Users browsing this forum: No registered users and 2 guests