Personally, i think that wud look a bit cheesey.
I think if no mod is specified the default one should run and u shud be able to select a mod to run from there.
Now i have the heightmap editing pretty much done im working on the tile editing.
Printable View
Personally, i think that wud look a bit cheesey.
I think if no mod is specified the default one should run and u shud be able to select a mod to run from there.
Now i have the heightmap editing pretty much done im working on the tile editing.
Yea i noticed that in some vector code i had from a site. odd lol.
Kewl :)
hmmm, i was thinking.
We should have three files for each map.
1) A configuration file which holds stuff like map size, name, attributes and any other things that need to be included.
2) The heightmap data.
3) The tilemap data.
How should the tilemap be stored ?
I guess you could have an array of the textures. then each vertex just has an index into the texture array ?
It will be one file, binary.
And yes, the tile map will be stored as a list of textures, and then indices into that list = ).
Why do you think it would be cheesy? We could do a lot in there =).
Z.
Well, okay if you want to put something there then do. i wudnt bother with it yet tho. its more of something that needs to be put in at the end.
Of course =).
Z.
I've been thinking of an auto-texture generator. You import the heightmap, and it generates the base terrain (ex. cliff, sand, grass, rock, whatever) based on slopes and such. Then you could add in a sealevel, and change bodies of water to marshes and stuff :)
This could be VB - meaning a part where I could actually help out with the coding... something I've wished I had the ability to do from Day 1...
Anyway, this is my thought on the subject. This is how it 'should' be done but you can change it of course manually, this is a starting point. And how about a random map gen for skirmishes and such? Shouldn't be too hard to create, if I give you guys that know C++ my VB source.
I'd like to see both in the first release of ToW... so give me suggestions that can improve what I've stated here :D
That auto-texture generator, do you mean in effect a 'tilemap' generator ?
That could easily be done, you could have an array of textures, each one has a height value which can be changed. the editor could thenrun through the heightmap and get the current height value and set the corresponding texture to it.
I think we should have the auto generator and the ability to place them on their own.
A random map generator shouldnt be too hard to do.
Yeah, that is what I'm saying. It generates the base texture for you, and then you add roads and marshes and the sealevel and stuff. You can of course change what this has made, but it's a starting point.
okies, kewl.
that sounds good. i have some src that im working the tile map thing off. do you want me to send it on to you ? so you can do this stuff, along with the src for the heightmap editor ?
Sounds good to me, guys. The tentative map format is going to be something along these lines:
And yes to the auto generator =).Code:[map_name][heightmap_width][heightmap_data...][tilemap_data...][future junk...
Z.
Got the property map working... =).
Z.
Cool beans :)
I'm starting work on the random MAP (not terrain) generator, and want to know what kind of formula I should use: I'm looking at Perlin Noise currently and it looks promising. Does that sound good?
I am quite partial to particle displacment. Essentially, pick a random spot on the map. Find its neighbors (NSEW). If the selected point is either the lowest, or tied for the lowest position, inscrease its height by 1. Otherwise, inscrease the position of the lowest neighbor. Repeat around 50000 times, and then apply a smoothing to the whole map. Generally looks pretty good =).
Z.
Hey, anyone remember this? Sas, and Psy, you might get some useful info from this tidbit... found it on something like page 9 of the thread =).
Extract the override.zip into the same directory as the other stuff. =).
Z.
Thats pretty sweet :D hmmmm
Yes I do remember that.... I'm currently working on my own type of terrain generation..
You start with a 8x8 set of quads. Each quad is given a value, of 1 to 5. 5 would be something like a valley, "punchbowl", cliff, or mountain. 4 might be a river, lake, etc. 3 would be a large hill, a plateau. 2 would be a small hill, or a small dip in the terrain. 1 would of course be a plain. Now each is given a "grow" value as well. That's how much it will override when 2 fields mix. Now, the 3rd value of each quad is the tesselation value; that's how many quads are created from it, each one of its children has a value, and it goes on.
Now the map is then created by tesselation, and creating values from all of these. To add natural effects, erosion and particle displacement will be added, and a smoothing feature as to make it "playable".
Now how does THAT sound? :)
Sounds like fun, Sas =).
Z.
okies, once the tile section is done i can probably come up with some renderer for combinging the two and showing it in 3D. i can probably then use that so you can edit the heightmap from the 3D view.
You can use my base code, Psy, if you like =).
Z.
Already at work on it and using ur code. Your using the coordinate system of y = height still yea ?
Always have, always will =).
Z.
okay the editor is going quite well. i got the views working a bit better. i was convertig the code across to my own project and it got messed on the way. its draing now tho not properly. it shud be done soon. ill then have it working off the heightmap (hopefully lol).
Nice. Been working with the property map thing, Am going to impelment object templates tomorrow.
Z.
hey, i was converting your code across into my own app. for some reason its coming out like below (attachment).
i dunno why, i thought it may be the indexbuffer though i checked through and that seems to be fine. same with the vertexbuffer.
any reasons why ?
Dont worry, i started a new project to fix it.
How did you manage that =)?
I was playing around with that code last night too, trying to change the 2D views over to SwapChains, and just render the same data in that view... would be nifty If I could get it to work (didnt spend much time with it though =).
Z.
Whats SwapChains ??
where can i get info on it ?
i know what did it. the indexBuffer was set as type integer to start with. when converting i put it as long but didnt change memory allocations. i think this was the error. its back at integer now and works fine. hmmmm. long would be better though!!
Could be =).
Swap Chains are essentially mini d3d devices... so you could have all three views actually being rendered... one with persepective, and two with orthographic projections so they are 2d =).
Z.
kewl, lemme know if you get that done.
what i was thinking is.
we could either have it so you can adjust the height from the 2d heightmap or from the 3d map.
i was thinking we could also make it so u can just use the 3d afterwards to make it so u can change the x,z value too so that u can kind of create walls and drop offs.
whatcha reckon ?
Cant, Psy. That would require actual collision detection between objects and the ground... because I can just grab the height of the terrain, because I dont know if there is an overhang or not.
FINALLY figured out what was wrong with my GameObject template class... VC should warn if it is using a default copy constructor...
Z.
okies.
at the moment the 3d and 2d are in two seperate apps. tongiht im hopefully going to make it so u can load a heightmap into the 3d editor and it changes the terrain based upon it. it shud then be this data that i save to a map data file.
ill play around and see what i can do.
Zaei, thats good. yea vc is a bit annoying hey :s
Also, can u get me some code to get lighting working in the 3d view. i want it so in 3d view i can see how it looks when shaded without sticking a texture on it to be able to see how it bends.
i uncommented the code u had and it just turned black :s
You would need to calculate normals during terrain generation(which I do not =), and then simply set up a light, and a material. Its the normals that are the tough part =).
Z.
hey, check this ;)
on the image box on the bottom right corner. right click it, then left click and watch.
u can change the image and then re - do this. the image has to be 25 by 25 at the mo.
i will make it so u can have any size later.
Sorry, use this one, its better ;)
Neat! It says "1" and then quits =).
D3D Init error?
Z.
yes, i dunno if the two are related but it bumms out on:
and i changed it to D3DCREATE_HARDWARE_VERTEXPROCESSINGCode:
Set direct3DDevice = d3d.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, direct3DPP)
from D3DCREATE_SOFTWARE_VERTEXPROCESSING.
newer version:
its a bit poo but once its incorporated it will work fine (i only advise maps of 128 in size coz on 256 and 512 it gives an overflow).
1) enter 128 in the text box on the details then click new (note the size must be the same as the image).
2) Right click the box.
3) Left click the box.
4) Then click Load texture
5) Then click Solid
N.B use the slider to change the scale of 0 to 255 Byte value to height.
most of this will be automated in the finished version ;)
Once the overflow problem is fixed (int to long changes) it will allow bigger maps. the problem is changing all the memory size allocations for index and vertex buffers. this is what broke it before :(
how do i change the back color ?
i think it shud be different from black with black being invlolved in the heightmap thing. im lookin it up on some direct x vb sites :s
Change the color in the call to D3DDevice.Clear()
Z.