2d or 3d terrain

Miscellaneous Forums/General Discussion/2d or 3d terrain

I've been working on the basis for a game recently, and got a few ideas from a game called Stronghold Crusader.

The first part I want to tackle is the terrain system, it looks like they use 2D (16x16 tiles, see image) but 3d would probably be faster for blitzmax (using minib3d).
image removed

IMO 2d always looked better then 3d in a strategy based game (think AOE, AOE2 etc), would you go 3d (if I do go 3d it would mean 3d only, mixing in 2d would cause issues - I think) or 2d (2d appeals more to me then 3d does)?

EDIT: I also do not know what to do in the case of cliffs/hills, in 3d hills would be simple, but I cannot get my head around how to smooth out 2d terrains with height differences.

EDIT: As for terrain saving/loading, I was thinking have the terrain always use a default set of ground tiles (like the image has dirt/sand) then the terrain file would just place or replace objects/tiles over the default ones, to reduce filesize. Which should equate to just numbers being saved for location and what to place.

EDIT: Another thing to note is that the game does not lag even a tad (on a last/current gen computer) with over 800 objects on screen (units, buildings, walls, towers, etc.)

EDIT: 2D downside: it would require drawing objects in z order, which would not need to be handled in 3d. Also I would have to knock up a custom audio playing system - for directional sound, in 3d that would not be an issue (klepto's module has minib3dsound right?)

2d always looked better? That is very true.

You have done very well and it look like remind me of Desert Strike!

You could do remake of Desert strike(if you want) with that graphics as I am sure all the Desert strike fans would be waiting for someone making of Remake :)

It would be a nice experiment to use 3D orthogonal mode in a strategy game. It would look a bit 2D with all nice features of 3D. Preparing the media for a 2D strategy is really hard. Lots of units rendered in different rotations with different animations and a lot of frames.

You have done very well and it look like remind me of Desert Strike!

That is an image from Stronghold Crusader, I did not make that, but it is what I am hoping to acheive - or better.

EDIT: another benifit to 2d drawing, in the game I keep mentioning, you can press a key to lower the height of everything - buildings, terrain, towers, etc (to see things that would normally be obscured). In 3d that would require changing the position of vertices, and I don't think that would be fast, in 2d you could just change the global height differential and subtract it at draw time (this would also enable you to fade the height down/up - when said key is pressed slowly move up or down).

EDIT: Firefly's (company that made Stronghold) terrain rendering system is flawless, you can even change the rotation of everything onscreen (north south east west). Pretty funny if you compare Stronghold to Stronghold 2, Stronghold wins by miles. The 3d looks like crap in the second one.

You have High Expections to achive what Stronghold Crusader screenshot are. It going to take time but if you can Achive what Stronghold Crusader screenshot then you may or will get there in the end. It all about time and movation to finish them. :)

Isn't 2d in blitzmax, 3d anyway?

Isn't 2d in blitzmax, 3d anyway?

When was 2d ever 3d? it uses opengl (and dd3d I suppose), that doesn't mean things - images, text etc - are rendered in a 3d world (correct me if I'm wrong).

Very nice :D

Edit,

Aww, i thought that was yours. :C

Should be possible to recreate in 3d with a high enough res, possibly easier to manage too.
2d always has that nicer 'crisp' look tho.

Yep, i'm sure everything in blitzmax is rendered in a 3d world. Thus the real time scaling, blend modes and such. I remember a thread about pixel perfect collisions with images, which was causing slowdown, because it wasn't a simple case of comparing pixel arrays or something.

I don't think that screenshot looks that good anyway. In places it is very obviously tiled, there are not many curved edges, there's a problem with depth due to lack of shadows and and no real fringing. I haven't played Stronghold so it might be concentrating on another game aspect or limited by some other factor (e.g. all resources went into AI or something or the landscapes are HUGE).
I reckon World Creator can create graphics matching (or surpassing) the screenshot and would help in creating cliffs/hills. I haven't done it myself yet but there are some examples on their forums.

I'll agree, they don't have good smoothing (even AOE 2 has better), I'm not trying to get the same exact thing as them.
They definitely focused more on other aspects of the game, the ai is quite well and its all very well balanced.

Here is an image showing more of the graphics
image removed

Here is the same, only zoomed out further (clearly the terrain system needed to be fast - considering each player had upto 600 military units and unlimited peasant population, thats alot of stuff to draw.)
image removed

Most of the World Creator images I saw had little color or detail, and most had bits that were un-proportional.

EDIT:
Yep, i'm sure everything in blitzmax is rendered in a 3d world

Well ok, but seriously, I was referring to cubes, spheres and models etc.

Most of the World Creator images I saw had little color or detail, and most had bits that were un-proportional.

I think I know what you mean but I think that's a usage problem rather than a limitation of the product. The website owners don't do themselves many favours with enticing users as it's a bit of a mish-mash. However, I think it could be used to create a tileset and buildings similar to the above but tricky to say if that's not what you're after.

I'm someone who always likes when people go the traditional 2d route, ie pixeled/hand drawn/pre rendered images.

But I have to say. Seeing games like starcraft 2 have altered my view a bit. It is possible now to use 3d, and not have it look so...."3d". For lack of a better term. Not so polygonal and computery.

Actually warcraft 3 changed my mind, but I still preferred to see more traditional 2d graphics. Real handdrawn imagery and sprites have a certain appeal imo.

But after seeing sc2,( and other more recent titles ) I think you can do good things with whatever way you go.

Yep, i'm sure everything in blitzmax is rendered in a 3d world

Yeah, everything is rendered with a 3d system, but only in a 2d plane using orthographic projection. So for the sake of simplicity, can't we just call it 2d and be done with it? :o)

Yeah, i know :o)

[quote]
EDIT: another benifit to 2d drawing, in the game I keep mentioning, you can press a key to lower the height of everything - buildings, terrain, towers, etc (to see things that would normally be obscured). In 3d that would require changing the position of vertices, and I don't think that would be fast, in 2d you could just change the global height differential and subtract it at draw time (this would also enable you to fade the height down/up - when said key is pressed slowly move up or down)
[/code]

Just thought i'd point that out, since i thought he thought that it used pure 2d

How exactly would one texture a 3d terrain with small tile textures (lets say 32x32 tiles)?

EDIT:
Just thought i'd point that out, since i thought he thought that it used pure 2d

They may have used 3d acceleration? from the some 200-ish hours I've played the game I have found no evidence that they use actual 3d models or anything of that sort. (though I suppose the terrain could be 3d blocks with vertice position changes to make up for tiles that aren't supposed to be completely flat??)

Both have their pros and cons but i would go for a 3d solution as in my opinion it makes more sense for such a type of game. If you keep a certain viewing distance then you also don't need high res textures and so things still can look pretty detailed. If you have a fast terrain engine (something octree based for instance) this could be quite fast and for slower systems additional objects like trees could be rendered as billboards as well. Will be more work/slower depending on how you implement a path finding/walking system, do you make usage of the 3d terrain as well or keep a 2d collision map for this in memory and such things. It just gives you more freedom for both the look and the gameplay.

I don't think that a 2d system is slower out of the box as it depends on if the 2d is hardware accelerated and how you actually implement it, do you for instance just use blitzmax calls or do you put such calls together and make usage of internal openGL structures. Depending on what you do the trianglecount for the 3d version will propably be higher.

Anyway you have to keep in mind how you best generate the media. 3d will be a different way than 2d, so you should think about what fits best to you here too.

I agree, orthographic 3d in hi-res with mipmap off and the correct size/detail on the textures (ie. drawn to the approx size they will be drawn) can look almost as good and using 3D lets you use all those cool commands you wouldnt otherwise have.

The 3d path certainly out-weighs the the 2d path (with 3d I will already have shadows and other effects like physics - doubt I will need it though - in the newest version of minib3d).
I looked around and it seems some people were using tiled entities. But I never found much info on how exactly they work, does anyone have some experience with them?

I have no idea about what minib3d is able to but i doubt that you would have a reasonable dynamic shadow solution for a whole scene. Shadows in a 3d world due to performance/quality often still involve a combined strategy such as baked shadows for static stuff and some sort of dynamic solution for the more important moveable characters.

I'm looking to make maps saved in a custom format (ie not .b3d, .3ds etc) and objects will be placed around the map during gameplay, so baking would not work (objects will never be static, since this isn't an actual model we're talking about, everything will be placed in-game). However I could have prerendered shadow textures and overlay them on the ground when an object is placed (building, tree.. etc).

I think I will approach this by creating a grid (of 24x24/32x32 blocks) of the map size (2^n - eg. 256x256) and change around vertex heights. A brush should (?) work for applying tile textures, providing that I can brush on square textures (the only brush work I have seen brushes on circles - note that this is the first serious 3d project that I am attempting, so I have very little knowledge of this).

My EPR format is a dynamic props script that t.ed exports (you do NOT have to buy t.ed to use my loader/management code) maybe its what you are looking for (or can at least give you some ideas).
The code to handle dynamic props is freely available and so is the open file format under the 'world loader code' section on the ted page.

I don't want it to be in readable form and I can manage the creation of the format.

The only thing that stumps me now is how to texture the terrain.

I don't want it to be in readable form and I can manage the creation of the format.
Simply encrypt it then. All files are somewhat readable/editable to some extent without it anyway. Using placement scripts can be very useful and has many advantages.

The only thing that stumps me now is how to texture the terrain.
What about several dynamic quadpatch blocks which appear and disappear when in range with 1 large tile tex per block, scaled so the texture appears close to its true res on screen?
A lot of the textures ie, for 'generic landscape' with no unique features could be re-used.

Is minib3d a reliable and tested solution?

The way you build the terrain heavily depends on what you would like to do with it. If you're working with tiles it's quite easy but depending on how complex the terrain will get and your target platform looks like you could run into performance issues as the number of draws will increase and at some point turn into a bottleneck.

You either could combine a certain number of tiles into bigger meshe(s) or you just go for one big mesh without any tiling were you have to implement some sort of LOD (depending again on the target platform, the size of the terrain,...). At least if you're dealing with one big mesh you can also write you own terrain painter with some splatting.

But doing all this right certainly isn't a small job for a first serious 3d project...

I think I know what you mean but I think that's a usage problem rather than a limitation of the product
Other then what I mentioned, there is a lack of community activity (which always puts me off from products of the sort), and the price tag is a bit high (76.90 USD).

What about several dynamic quadpatch blocks with 1 large tile tex per block, scaled so the texture appears close to its true res on screen?
I have no idea what your talking about there.

Is minib3d a reliable and tested solution?
Not exactly, but the new version should prove to be adequate - I'm not even sure if what I'm making will be commercial (everything is pretty much in contemplation stage, yet I still want to develop a terrain system).

you could run into performance issues as a number of draws will increase and at some point turn into a bottleneck
What kind of things would raise number of draws? shadows? multiple texture layers?

Draws are already raised by each individual mesh. For instance dealing with 12000x12triangle objects (cubes) is already slower than 12x12000triangle objects.

I see, so would brushing textures onto a terrain/mesh raise its triangle count (I would assume not)?

Nope, it's about clever uv calculation...

I have no idea what your talking about there.


-A quadpatch is a square bunch of quads (a square made of 2 triangles)... a simple flat "grid" mesh if you will.

-Dynamic means they only get created from a memory template when you need them and removed when you dont. So you can create draw-in draw-out zones off screen.

-A Large texture drawn in say paintshop, complete with roads, mud, grass, paths etc is then put on each quadpatch.

The textures are designed beforhand so their edges work with both each other, basically in the same way as normal 2D terrain tiles would, just on a much larger scale allowing you complete drawing freedom except for at the very edges (because of the need to tile).
These textures can then be used as a template for creating heightmaps (or you can use one of the many Wysiwyg editors out there).

Normally 1 large texture would look blurry in say.. an FPS game, but because its top down, if you make one terrain block(quadpatch) the correct size, -so that when viewed with the camera from above, it is drawing close to your screen or viewport's size then the texture would appear similar in resolution (with mipmapping tuned off) to when it was drawn.

A Large texture drawn in say paintshop, complete with roads, mud, grass, paths etc is then put on each quadpatch
Do you mean "large" as in 2048x2048?
I don't know what you mean by this, you would basically have a texture with a bunch of different textures on it? wouldn't that just look like the same exact thing over and over (grass sand road; grass sand road; grass sand road etc..)?
OR are you referring to separate large textures for individual tiles? (I assume not, as you mention "complete with...")

I mean separate large screen (width) sized textures.

Unique ones when needed like for towns etc and a good variety misc. ones for areas of forest or grasslands etc which can be re-used many times, but all must have some kind of tiling standard, which isnt hard to do (think of the way you would plan small 2D terrain tiles but in this case a terrain tile could be, for example; half a village ).

1 Terrain block when viewed from the camera above would match the dimensions of the screen in the X axis. 1024x1024 should provide crisp enough detail, almost looking like the original 2D image. (even at 2048 would look ok as the antiA would deal with that.)

Okay, so you mean when an object is placed I could use that to place detail around the object (ie. a building is placed, and a texture - containing whatever pertains to the building - could be placed in its location on the grid). Think I got it now :)

I was thinking kind of the other way round, as in draw the texture first, texture terrain block and then place props in the planned locations. (you could even draw notes on the terrain to be hidden by objects eg, "house here").
I think the other way round would/might be more difficult to plan.

make a compromise and go with 2.5D