Creating a Tycoon Game Part 1 - Writing the ISO engine

Posted on:October 22 2018

For that Business Simulation Game I am working on, I decided to go with an isometric view of the buildings. 3D would have been possible too - especially since I am also working on that 3D game engine - but I think it is much easier to place buildings and have a nice overview with an isometric 2D view.

Programming wise, it is a mixture of 2D and 3D, and you have a combination of the disadvantages and benefits of both: Mostly everything is nearly in screen coordinates but you still need to do some z-sorting and clipping. It's easy to implement, even calculating the position of an iso-tile is very easy (pseudo language):

getIsoTileScreenPosition(x, y)
var tileWidthHalf = isoTileWidth * 0.5 * zoom;
var tileHeightHalf = isoTileHeight * 0.5 * zoom;

return position2D( x * tileWidthHalf - y * tileWidthHalf,
x * tileHeightHalf + y * tileHeightHalf );

I've written about 5 isometric engines during the last 20 years, in Delphi, Basic, C, ActionScript and C++. But none of these had zoom, which I definately need for this game. I experimented a bit, and after a while I felt that I found a very nice way to do it: The engine is able to zoom smoothly, but the user only can switch between 5 or 6 fixed zoom steps. This makes the world and game feel very responsive: It looks very nice when zooming is moving between two fixed steps, and the user is still quickly able to switch between two or more of his preferred zoomed views:

I'm satisfied with how this worked out so far. I'll post a new update next week.
If you want to get a mail once the game is playable, you can subscribe to the games newsletter on its website.


But where are the zoom buttons in that gif?
2018-10-23 07:32:00

I was zooming with the mouse wheel, but yes, zoom buttons should be added there, right.
2018-10-23 08:26:00

I like these short technical updates! The game looks very polished already.
2018-10-23 10:17:00

I love the art! Did you made it by yourself?
2018-10-23 11:15:00

No, I'm pretty bad at Art, unfortunately :/
The last game where I made the Art myself was PostCollapse (when it was early access still), and people hated it because of that.
2018-10-23 11:40:00

Add comment:

Posted by:

Enter the missing letter in: "Internation?l"




Possible Codes

Feature Code
Link [url] [/url]
Bold [b]bold text[/b]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]