Help, 2D to 3D
Moderator: Moderators
Help, 2D to 3D
Hi I'm a computer science student and I want to dive into 3D game development.
I only have 2D basic knowledge (c, c++, java..) now i want to improve my skills and do some 3D projects (games) i would like to keep working with a c++ base but its no "mandatory".
I've spoken to some teachers and i have a starting point to make my map.
I know what technique I'm going to use (don't know its name but i will explain it) and i am looking for a game engine the allows me to do that kind of terrain modulation.
So i want to do a 3D map based on a 2D map source. "x" and "y" coordinates of each node/rig of the surface would be the same as the 2D source and for the "z" index i would have a set of colors that i would paint my 2D with and each color would be a specific value of "z".
I could use: white -> zero (the lowest "z") and black->1 (the highest "z") and all shades of grey would have assigned values form ]0;1[
So does anyone know if i can do this with spring engine? Do u know any tutorials, books or sites about the subject so i can get started?
Thx in advance!
I only have 2D basic knowledge (c, c++, java..) now i want to improve my skills and do some 3D projects (games) i would like to keep working with a c++ base but its no "mandatory".
I've spoken to some teachers and i have a starting point to make my map.
I know what technique I'm going to use (don't know its name but i will explain it) and i am looking for a game engine the allows me to do that kind of terrain modulation.
So i want to do a 3D map based on a 2D map source. "x" and "y" coordinates of each node/rig of the surface would be the same as the 2D source and for the "z" index i would have a set of colors that i would paint my 2D with and each color would be a specific value of "z".
I could use: white -> zero (the lowest "z") and black->1 (the highest "z") and all shades of grey would have assigned values form ]0;1[
So does anyone know if i can do this with spring engine? Do u know any tutorials, books or sites about the subject so i can get started?
Thx in advance!
- FireStorm_
- Posts: 666
- Joined: 19 Aug 2009, 16:09
Re: Help, 2D to 3D
Hi, and welcome
I have experience making spring maps, but I didn't have to code to do it.
As you can read in the Map development section of the wiki a spring map is compiled which combines (at least) 4 major image files.
Their respective functions are chaptered under "The Components of a Map". As you can see one of them is called "hightmap". This hightmap contains the z-axis data as you described it (though bright white is highest and pitch black lowest.)
The actual values of the highest and lowest points on the map are specified in a .bat file which is used when compiling the map. (Where 0 indicates the water level if it exist.)
That is about the extent of my knowledge on this subject. I suppose you would want to look at the map compiler and it's source, though I couldn't help you with any further questions there. I hope this helped a bit though.

I have experience making spring maps, but I didn't have to code to do it.
As you can read in the Map development section of the wiki a spring map is compiled which combines (at least) 4 major image files.
Their respective functions are chaptered under "The Components of a Map". As you can see one of them is called "hightmap". This hightmap contains the z-axis data as you described it (though bright white is highest and pitch black lowest.)
The actual values of the highest and lowest points on the map are specified in a .bat file which is used when compiling the map. (Where 0 indicates the water level if it exist.)
That is about the extent of my knowledge on this subject. I suppose you would want to look at the map compiler and it's source, though I couldn't help you with any further questions there. I hope this helped a bit though.
Re: Help, 2D to 3D
So you want a heightmap?
It's already how Spring maps are made : A 2d greyscale image to represent the height.
(And another 2D image to represent the texture, because playing on a colorless map would be boring, and some other map for terrain and metal distribution).
Also, C, C++ and Java are neither 2D or 3D.
Games can be either 2D or 3D.
And games are often written using programming languages.
So your initial paragraph makes little sense.
It's already how Spring maps are made : A 2d greyscale image to represent the height.
(And another 2D image to represent the texture, because playing on a colorless map would be boring, and some other map for terrain and metal distribution).
Also, C, C++ and Java are neither 2D or 3D.
Games can be either 2D or 3D.
And games are often written using programming languages.
So your initial paragraph makes little sense.
Re: Help, 2D to 3D
I know, what i meant was that i only worked (with does languages) in 2D. Console app and some windows forms for GUI. And i would like to keep working with C++ for 3D games.zwzsg wrote:...
Also, C, C++ and Java are neither 2D or 3D.
Games can be either 2D or 3D.
And games are often written using programming languages.
So your initial paragraph makes little sense.
What u describe about the map is pretty much what i need, so I'll download spring now.
I'll search for some documentation on Spring Engine. But if u could tell me some source of information i would appreciate it too (tutorials, some "Spring basic training"...)
Thank you for those quick answers, looks like a good community

Re: Help, 2D to 3D
As far as programatically changing maps goes you may want to check the spring wiki for synced control and search for heightmaps
Re: Help, 2D to 3D
I still don't really get what you're trying to do. There is no need to edit the engine to make maps out of a heightmap.
You can:
A) Make a bunch of image, (including a greyscale one for the height) and compile them into a Spring map with mapconv.
B) Write Lua code that edit the heightmap of a map during the course of a game.
For A, check http://springrts.com/wiki/Map_development
For B, you'll need http://springrts.com/wiki/Lua_SyncedCtrl#Heightmap
But B also requires that you understand what are Spring gadgets and to know the Lua programming language http://www.lua.org/manual/5.1/
There are very few maps made with B, here is one: http://springrts.com/phpbb/viewtopic.php?f=13&t=27613
You can:
A) Make a bunch of image, (including a greyscale one for the height) and compile them into a Spring map with mapconv.
B) Write Lua code that edit the heightmap of a map during the course of a game.
For A, check http://springrts.com/wiki/Map_development
For B, you'll need http://springrts.com/wiki/Lua_SyncedCtrl#Heightmap
But B also requires that you understand what are Spring gadgets and to know the Lua programming language http://www.lua.org/manual/5.1/
There are very few maps made with B, here is one: http://springrts.com/phpbb/viewtopic.php?f=13&t=27613
Re: Help, 2D to 3D
I just want to be able to get any 2D map with an altitude reference a make a 3D game map. Even if the 2D is not made by me.zwzsg wrote:I still don't really get what you're trying to do. There is no need to edit the engine to make maps out of a heightmap.
For now i also think the option "A" is good enough for my game.
I will for sure take a deeper look at Lua scripts later on.
About working with the engine for what i could research till now i did only found information in the "springrts.com/..." domain. Aren't there any books or other sources of info? I do understand that its much easier for commercial license software to get good documentations and lots of user made tutorials like YouTube videos...I couldn't (yet) find any kind of those info sources.
But, please, don't get me wrong. I got the answers i was looking for here, i already download the engine and ill start experimenting around.
So if you know some other source of info on working with the spring engine please let me know if not i thank you all for the help and this topic can be [CLOSED].
PS: I hope to be back soon with some results

Re: Help, 2D to 3D
There is the wiki. On the top of each page, click this button:Mortis wrote:About working with the engine for what i could research till now i did only found information in the "springrts.com/..." domain. Aren't there any books or other sources of info? I do understand that its much easier for commercial license software to get good documentations and lots of user made tutorials like YouTube videos...I couldn't (yet) find any kind of those info sources.

There is also the Map Tutorials & Resources subforum.
I know there are video tutorials about making units for Spring on youtube, but I'm not sure about map making.
Re: Help, 2D to 3D
Here's my suggestion as a student it is not enough to simply demonstrate mp making. Instead, demonstrate the algorithm for heightmapping. Use our well tested techniques to create a demo map.
https://github.com/jahwag/cheeselobby/b ... htmap.java
The link above contains the source code to a very basic heightmap renderer in Java. It uses lwjgl which is a JNI binding of opengl for Java. Also there are some unitsync interfaces for loading spring maps.
To understand the code you will need to read some whitepaper describing the algorithm. Note this implementation is suboptimal. It is simple however.
You can search articles and PM me if you need advice.
I wouldn't start with spring engine code as it is not OO and too complex for a short project. The code I posted is part of a now deprecated lobby that I developed as a student two years ago in a master's course. You don't need to understand the whole of it just the mapviewer package.
https://github.com/jahwag/cheeselobby/b ... htmap.java
The link above contains the source code to a very basic heightmap renderer in Java. It uses lwjgl which is a JNI binding of opengl for Java. Also there are some unitsync interfaces for loading spring maps.
To understand the code you will need to read some whitepaper describing the algorithm. Note this implementation is suboptimal. It is simple however.
You can search articles and PM me if you need advice.
I wouldn't start with spring engine code as it is not OO and too complex for a short project. The code I posted is part of a now deprecated lobby that I developed as a student two years ago in a master's course. You don't need to understand the whole of it just the mapviewer package.
Re: Help, 2D to 3D
Hello!
I would like to point you to World Machine. http://world-machine.com/download.php?page=basic
I have made countless maps with it, and if you read it's tutorial, you will find it more than capable for starting off.
I would like to point you to World Machine. http://world-machine.com/download.php?page=basic
I have made countless maps with it, and if you read it's tutorial, you will find it more than capable for starting off.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Help, 2D to 3D
Mortis, you will probably find this about 500000x more helpful than the map development wiki page:
http://springrts.com/wiki/User:Forboding_angel
http://springrts.com/wiki/User:Forboding_angel
Re: Help, 2D to 3D
I disagree with your teachers... clearly the first 3D game a 2D game programmer should make is first person asteroids...
Re: Help, 2D to 3D
Perhaps this was meant in jest? From what I understand, he's not been asked to make a game. That is more his general interest, 3D games development.SinbadEV wrote:I disagree with your teachers... clearly the first 3D game a 2D game programmer should make is first person asteroids...
When I was learning in my spare time, I jumped straight from 2D sprite drawing with SDL to OpenGL heightmaps. The theory behind it is simple enough that you could make a program that draws a heightmap in very few lines of code.
A basic heightmap renderer only requires basic programming knowledge such as matrices, and some opengl 101 like vertex drawing and matrix transformations for moving the camera. This is very much in line with first and second year CSI curriculum where you take linear algebra and OO programming.
Now what I am suggesting is probably a bit beyond what he imagined, it sounds like he simply wants to make a map. But but but..teachers might be more impressed if he demonstrated that he really understands the theory by implementing a heightmap renderer and making a demo map. This could be spare time or future work if he's really interested in games development.
Re: Help, 2D to 3D
Thank you all for the help, i got lots of info to keep going now. Really great community.
I'm getting detailed topo maps and making them height maps using GIMP.
I want to become a programmer, i just don't know what I'll program "about", what would be my work field. Maybe its in the game industry, maybe not... anyway there's never to much knowledge.
Eventually I'll do some little funny games just 4 the lulz
At this moment i only want to go hands on, start to give form to my idea and see where it takes me.
Once more, thank you all!!
I'm getting detailed topo maps and making them height maps using GIMP.
Yes I'm doing this on my own because i want to expand my knowledge in 3D game development as soon as possible. I'll wont have "computer graphics" lessons till next year.Cheesecan wrote:Perhaps this was meant in jest? From what I understand, he's not been asked to make a game. That is more his general interest, 3D games development.SinbadEV wrote:I disagree with your teachers... clearly the first 3D game a 2D game programmer should make is first person asteroids...
I want to become a programmer, i just don't know what I'll program "about", what would be my work field. Maybe its in the game industry, maybe not... anyway there's never to much knowledge.
Eventually I'll do some little funny games just 4 the lulz

At this moment i only want to go hands on, start to give form to my idea and see where it takes me.
Once more, thank you all!!
Re: Help, 2D to 3D
this will sound dickish but it is a GOOD question to ask yourself. What is a programmer? if you don't know, how do you know you want to become one. It isn't a shirt you wear, it can be your lifestyle and dictate the stuff you do in your spare time.Mortis wrote:I want to become a programmer, i just don't know what I'll program "about", what would be my work field
Re: Help, 2D to 3D
But it can be quiet addicting.. i myself was a artsy person, and develd into it because it allowed for controll of maschines. And i learned to luv it.
I was slow. But steady.
My advice, get yourself projectpregnant, think something you want to code for some project (something allready working).. and then plan, start some little (but working) addition, and expand that.
I was slow. But steady.
My advice, get yourself projectpregnant, think something you want to code for some project (something allready working).. and then plan, start some little (but working) addition, and expand that.