Tuesday 29 September 2015

Tiles!

Now the project is all set up and I've imported Kenney's spritesheets, the next step is to actually get something drawn on the screen.

With Paradox it wasn't too difficult to get some sprites set up. For now I'm just randomly drawing either a grass sprite or a stone sprite (proper terrain to come in the next blog). 


This was quite straightforward, but performance wasn't great as a 100 x 100 sprites means 10,000 GPU draw calls every frame. Whilst rendering this many sprites, the FPS sometimes dropped below double digits. Not acceptable at all.

To get around this performance issue, I will be rendering the tiles onto a texture. This means there will only be the performance hit of rendering the 10,000 sprites once, and from then on just there will be just one texture per 10,000 sprites. This means performance even on quite low-end machines should be fine - I'm developing on a laptop with an Nvidia GeForce 750m, which is fairly low end in desktop terms. Plus, it's not exactly AAA graphics, so good performance will be expected!

Figuring out how to draw the sprites onto a texture was somewhat challenging, but with the help of the Paradox forums (http://forums.paradox3d.net/) and the samples that come with the Paradox engine, I was able to draw batches of 100x100 sprites onto textures, and then add these textures to the scene using the normal entity/component structure. This has massively improved performance - it can now draw 10x10 cells of 100x100 squares (the equivalent of 1 million sprites) and the framerate sits at a steady 60FPS (capped by VSync).

Here's a slightly zoomed out screenshot using the new drawing method:

Looks the same, but the performance is orders of magnitude better.

The next blog entry will look at adding some terrain features such as forests and lakes instead of randomly placing grass or stone. There won't be such a large gap between the next blog entry and the previous blog entry, so stay tuned! 

Tuesday 28 July 2015

Creating the project

This post is just a quick explanation of how I'm setting things up in Paradox. I'm not entirely sure what the best practices are, so please comment if you see something stupid!

I'm going to start with one of the sample projects, and then change and remove things from there.


I've started with the Character Controller Sample, as it has a camera, some sprites and a collision plane to use. Saying that, almost everything will be removed. We'll keep the camera and the ground, but get rid of everything else.


Next I'll download some sprites by Kenney. I'm going to grab the Roguelike RPG pack and the Roguelike Character pack.

Once these are imported the next steps are to actually get something showing on the screen!

Monday 27 July 2015

Ways Of Old

This post will be a quick introduction to what Ways Of Old is, and what the point of this blog is!

Ways Of Old (working title...still not sure about it!) will be an RPG with RTS elements. The general idea is that players start out as either a sellsword, merchant or diplomat in a fairly intricate procedurally generated world. The world will be filled with villages, towns and cities, and thousands of NPCs that roam about the world doing their day-to-day business. Each NPC will play a role in the world; farmers supply the population with food, miners with iron, and lumberers wood. With no food people will starve; with no iron then weapons cannot be smithed and with no wood siege weapons cannot be constructed.

As you explore the world you can progress from a simple sellsword to the leader of a mercenary warband capable of turning the tides of war . . . for the right price! Merchants will have the opportunity to grow their empire with shrewd business transactions (or killing off the competition!). Diplomats will start the game dealing with the petty quarrels of peasants, but soon they could find themselves deciding the fate of nations...

Now, onto the purpose of this blog... it will use it to post updates to the development of the game. Anything particularly challenging will make it in, and also anything novel that I come up with! I won't be including all the source code (though I do plan to open source it once it's released), but it might come in handy, and hopefully it will be interesting!

I will be using the Paradox game engine, as it's a nice, modern open source engine. It's written in my favourite language (C#), and from first impressions it's really powerful and flexible. For my assets I will be starting off with the wonderful assets made be Kenney (http://www.kenney.nl/) as they're free and look great!

That's all for now, stay tuned for more!

Development Blog!

This is going to be the development blog for the upcoming indie RPG/RTS "Ways Of Old" (working title). Stay tuned for more updates and site improvements in the coming days...