Jump to content


some idea about game editor?


5 replies to this topic

#1 Dape

    New Member

  • Members
  • Pip
  • 3 posts

Posted 07 November 2008 - 08:02 AM

Hi,guys.

Recently, I want to create a game map editor,just like star craft's map editor,I can put something on this map like a water , well, of course I have to obey some basic rules,for example, a lake must have four banks and a building must build on a flat land, I can not build a roof on a hill or near a water directly, there must be some changes I have to make, like add some extra terrain, well, you can understand what I am talking about if you use star craft's map editor.

I google a lot, I just found some algorithm about random game map editor, I get a expand idea, however, I do not have to do that in my situation,is there any good idea for me?

thank you guys!

#2 alphadog

    DevMaster Staff

  • Moderators
  • 1601 posts

Posted 07 November 2008 - 03:25 PM

Wow. That first sentence has got to be the biggest run-on sentence this week. Commas != periods. Sir, you are a winner! :huh:

Also, I'm not sure exactly what you are looking for. There are many different kinds of map editors, but the key questions are:
- What kind of maps do you want, generally? Inside? Outside? Small areas? Planetary? 2D, 2.5D or 3D? Tile-based or not? etc...
- For what purpose? A specific game? A specific file format?
- Are the maps to be auto-generated?
- Who's the intended user? Are they casual gamers, or 3D artists/modelers?
- etc...

Don't mean to be harsh, but basically giving any advice right now and without much more problem-defining information is like trying to kill a fly with a shotgun in a dark room.

#3 imerso

    Senior Member

  • Members
  • PipPipPipPip
  • 426 posts
  • LocationBrasil

Posted 08 November 2008 - 12:12 AM

IIRC Starcraft was a 2D, tiled-based game with an orthogonal view.

So, I think if you make tile types with a property that describes what that given tile accepts above it, you already got the trick done.


// simplistic tile class

enum TileType { Ground, Water, ... };


class Tile

{

    TileType tileType;

    ....

}


...


void PutSomethingHere(Tile tile, Thing thing)

{

  if (tile.tileType == TileType.Water)

  {

    // ... check if thing can be put over Water...

  }

}


Of course, the snippet above is absurdly simplistic, I would probably make some arrays to relate things that could be put over ground, water, terrain, etc, and check for those relations against a tile every time the user tried to put something over that tile.

#4 Dape

    New Member

  • Members
  • Pip
  • 3 posts

Posted 09 November 2008 - 06:50 AM

alphadog said:

Wow. That first sentence has got to be the biggest run-on sentence this week. Commas != periods. Sir, you are a winner! ;)

Also, I'm not sure exactly what you are looking for. There are many different kinds of map editors, but the key questions are:
- What kind of maps do you want, generally? Inside? Outside? Small areas? Planetary? 2D, 2.5D or 3D? Tile-based or not? etc...
- For what purpose? A specific game? A specific file format?
- Are the maps to be auto-generated?
- Who's the intended user? Are they casual gamers, or 3D artists/modelers?
- etc...

Don't mean to be harsh, but basically giving any advice right now and without much more problem-defining information is like trying to kill a fly with a shotgun in a dark room.



thank you, what I am trying to do is just like starcraft's game map editor, 2D,tile-based, and of course a specific game, theose maps are not auto-generated, I just want to add those objects by hand one by one,so it will look nicer and reasonable than auto-generated maps.

I do not know how to do this, if I use some backward algorithm, it is very complicated and very hard to find a reasonable solution in a given time, like can I put a water here?can I put a roof there? every cell have a lot of options to consider, so, I wonder there must be some better way or a algorithm to do this.


thanks for your time and your advice.

#5 Dape

    New Member

  • Members
  • Pip
  • 3 posts

Posted 09 November 2008 - 07:31 AM

vrnunes said:

IIRC Starcraft was a 2D, tiled-based game with an orthogonal view.

So, I think if you make tile types with a property that describes what that given tile accepts above it, you already got the trick done.


// simplistic tile class

enum TileType { Ground, Water, ... };


class Tile

{

    TileType tileType;

    ....

}


...


void PutSomethingHere(Tile tile, Thing thing)

{

  if (tile.tileType == TileType.Water)

  {

    // ... check if thing can be put over Water...

  }

}


Of course, the snippet above is absurdly simplistic, I would probably make some arrays to relate things that could be put over ground, water, terrain, etc, and check for those relations against a tile every time the user tried to put something over that tile.


Thanks for your time and advice.


That is true, I already define those basic rules, like I can put water near a ground, I even already made those tiny picture, such as the left ,right,up, down,and center part of a building, so, if put those picture on the right spot, I will get a building.

The biggest problem is I do not how to make some necessary changes, for example, If I want to add a building near a lake,the building maybe will take some lake's space or cell, the lake will become smaller or vanished, so, I have to re-generate the lake's picture, or add a new terrain between them,If I can not put a water near a building directly,and so on.


I think it is very hard if I use backward algorithm.

Anyway, thanks for your time.

#6 alphadog

    DevMaster Staff

  • Moderators
  • 1601 posts

Posted 10 November 2008 - 06:32 PM

I'm still not sure what you mean by a "backwards algorithm". And, if one can't define a problem properly and with detail, the solution is always beyond reach.

Maybe if you gave us details on one specific instance of a "backwards" problem?

My suspicion, based only on what you've said so far, is that you adjust the map graphically as the changes are made and you do this directly to the map. IOW, you store the map itself as a graphic, rather than data about the map which is used to refresh an image upon need. Is this correct?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users