-
hmmmm,
okay, ill have to look into making the terrain page for the editor and get it to do the nice drawing. I had something similar to this tho i think i deleted it :(
I can make it load a bitmap for height. i could make it load the texture view and save it.
Do you have a current file format that i should save to or not ?
lets say u have a grid like this:
Code:
|------|------|
| A - B |
|------|------|
| C - D |
|------|------|
Would ABCD make up the vertex for a quad ? would it be done like that ?
-
okay, i did this in like 30mins.
its utter ****e at the moment. gimme a few days and ill have a good one. this lil demo shows how a map editor could be made. the tile changing, selection.
note its only drawing the no of tiles visible on screen.
i would make it a nice MDI interface, then u cud have flat tiles view (tiles wud be actual tile bitblt'd on), a 2d heightmap view and a 3d view that can have either or both applied.
-
Cool :) I still plan to make a point-n-click interface for DScript (for beginners you know).
-
1 Attachment(s)
-
I made a better system for getting which tile.
the variables at the mo are, tile size (on screen - width and height). no of tiles in map (width and height). no of tiles shown on screen (width and height).
-
1 Attachment(s)
different tile selection/better selecting code:
-
in vb i can get a map of width 12500 and height 12500 (tiles that is).
is that adequate ?
-
1 Attachment(s)
hey, check this:
furthest to right slider does no. of tiles shown on screen,
middle right slider does tiles width/height
right click shows the tile coord (also tile array index).
[edit]
selection code is messe,d now fixed ;)
-
You guys are kicking arse =). Ill check them out in a bit =). No, there is not set map format as of yet. I am still thinking about how to do the rendering. Here is the problem... my card(I think we will call that the minimum) can only support 2 textuers at one time. Essentially, on one triangle, we can have 2 types of terrain. If this is ok, then we will just go with the regular way we are doing it now. Otherwise, I have to come up with a new type of rendering.
I am writing a console editor right now. Simply, you can add classes, and class members, and write the to a file.
Z.
-
What about any (rare) occurances of terrain where 3 or 4 different types meet on a single tile? We could provide an "ugly" tile for those that don't meet the requirements (or blit another triangle at a slight speed loss), and for those that can support it, do it. How 'bout that?
-
No, just restrict in the map editor =). That would be the best choice. I tried to figure out how I would support up to 4 terrain types, but it involved rendering each tile 5 times (once for each terrain texture, and once for the shadows). Even with optimization, that would NOT be a very good solution. Besides, 2 terrain types per triangle is all that is really required.
Z.
-
okay, i will be off out soon to skate. once im back ishud have about 2-3 hours to work on the editor. im going to make up a MDI interface as described before.
one problem i just thought of is that what exactly is each one of those squares in the editor ? if theyre equal to a vertex then thats good coz you can have the heightmap done easily and allows for around 12,500 tiles by 12,500 tiles.
but for the actual tile placing ? that type of editor wont do. i think im going to have to do two styles.
so it is said here, those files posted before hand will be for heightmap editing.
-
1 Attachment(s)
Mk, here is the first test of the console editor... tell me what you think...
Z.
-
Good, but I want to make function insides now :D Hey Zaei, would you mind sending the source?
-
Sweet! heh, thats pretty kewl
-
1 Attachment(s)
Ill just post it here (nothing secret =).
Z.
-
Alright, I did some more thinking, and came up with some of the functions we are going to want in the game. Here we go (off the top of my head, left the list somewhere o.O).
Code:
General Unit
-Goto(x, y);
-Attack(unit);
-Cast(spell, target);
-CastArea(spell, centx, centy);
-Stop();
-GetPos();
-GetInfo();
Peasant
-Goto(x, y);
-Attack(unit);
-Stop();
-Build(building, x, y);
-Repair(building);
-Upgrade(to, where); // what unit to upgrade to, and where to
do it
-Gather(resource);
-GetPos();
-GetInfo();
Building
-Train(unit-type);
-SetRalleyPoint(x, y);
-Research(upgrade);
OR
-Research(upgrade, unit); // if unit specific upgrades
-GetPos();
-GetInfo();
They are pretty much self explainitory, anything to add?
The Building::Train() method is just an idea I came up with...Why not allow buildings to train units from scratch, but make it take x times as long, and y times as expensive?
Well, there it is =).
Z.
-
Thats looking pretty good. Im still working on this editor :s
-
With the editor, when ur editing the actual tiles. it will be that
that tile applies to the four vertices:
Code:
1--2--3--4
| a| b| |
5--6--7--8
| | | |
o--o--o--o
So tile a uses vertex 1, 2, 5 and 6. b uses 2,3,6 and 7.
When editing a heightmal, one square (also known as a tile) is equal to a pixel. so if u want a map that is 1024 tiles by 1024 it will create one form with a 1024x1024 grid on it for hieghtmap editing and a 1023 by 1023 grid of tiles.
-
how big tile wise do u reckon an average map size would be ?
-
You got it Psy =).
Hey, do you think that for the heightmap editor, you could make it with the 4 view thing (ie, a modelling program)? Also, each terrain type centers directly ON a vertex, so you need to assign each vertex a terrain type, NOT each tile(i know thatis a bit odd, but there you have it =).
Well, Just to illustrate, each world in Black and White is 128x128. That should suffice for a small map, 256x256 for medium, at MOST 1024x1024 for large.
Z.
-
so if im right you have like one square = a vertex and each vertex has its own tile or do u mean vertex type? so i just make two forms with the same size grid ?
i got kinda confused between terrain type and tile.
im not sure bout the four view thing. i think it will be three. one for a birds eye of the heightmap, one for a birds eye of the tile map and one 3d moving (rotation/movement) for both that u can toggle the heightmap/3d in or combine them.
-
Ok, Psy, however you want to set it up =).
Take a look:
Code:
A---B---A
| | |
B---A---B
Each square is a tile, while each VERTEX has its own terrain type. So, if we allowed it, each tile could have FOUR types of terrain on it (one for each vertex). In actuallity, "tile" is really just a concept =). Just be sure that you can assign a vertex a terrain type, and that for every vertex that is adjacent to any given vertex, the total number of terrain types is 2 or less:
Code:
1----2----x
| \ | \ |
4----O----3
| \ | \ |
x----5----6
There are 6 vertices adjacent to O. When each of them are assigned terrain types, the total number assigned to that set of vertices can be at most 2.
Z.
-
okay, ill see what i can come up with. its just a bit tricky in my head coz there is tiles and then squares in the editor can either equal a tile or a block in the heightmap but a block in the heightmap is equal to a vertex.
ill get the heightmap bit done first as thats the easiest.
im doing the gui at the mo
-
Ive found that using a line grid for heightmap editing works well. Instead of blocks, just draw grid lines, and use those to edit the heightmap. Then, in either another window, or a smaller "minimap", just draw a greyscale heightmap. Let me whip up something quick...
Z.
-
that could be good.
i could draw the tile base (ie the actual texture) then draw the line on top of that for the heightmap:
Code:
-------------------
| |
| o--|----o
| | |
|----|---|---------
| | |
| o--|----o
| |
-------------------
??
-
1 Attachment(s)
Here, just a quick sample thing...
Z.
-
ah, i see what you mean.
thats how my system works except that it uses squares with a hi light around it so that u know which in effect pixel your editing.
you can clicl on one tyle to change it or move the mouse around and it does the ones it passes over.
it has a palette thing which u can select the grey-scale color from that you want to use.
-
i'll have a working document of what you want for the heightmap in a few ticks hopefully.
-
1 Attachment(s)
i gotta fix the rendering system but:
-
I understand where you're coming from, Zaei, on the building train issue.
It would be infeasible to have to order every peasant.
Consider this: percentage allocation.
5% warriors
45% peasants
50% floating pillars (hahaha... right)
Players could turn them on or off.
-
Yeah, we can tweak the numbers a bit, Jorj =).
Ill take a look at the thing later, Psy, Im outta here now.
Z.
-
No, I think Jorj means in-game, we talked about having a little management bar where you can assign newly born peasants to train to become whatever - ex. you could have 10% become swordsman.
-
Oh, well then, yes, we can do that as well =).
Z.
-
Ive been playing with the console some more... can now change model skins through the console =).
Z.
-
I am modifying the Input system again... I will now have key input redirected to the currently active window. Should make things nice =).
Z.
-
this editors still on a bummer at the moment. not too sure on the rendering system.
im going to have to write my own bitmap write routine (i have a C++ one) to save. coz SavePicture only uses what u can actually see in the editor window.
-
Psy, dont need one. Since maps are square, just write out one byte per height value (red, green, or blue component), with nothing else in the file. My load routine will simply find the file length, and take the square root (this is how the texture loader does it, as well).
Z.
-
-
Oh and Zaei - I don't agree on letting buildings train units themselves. It would ruin the reality (or semi-reality ;0) we're trying to create!