Sign in to follow this  

Need an idea on how to create map for 2D first person

This topic is 1592 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Right now I just wanna try to make a prototype of a game where you can walk around in a 2D world with first person view (like 2D dungeon crawler). I'm using SFML 2.0 for now. I already had the very basic idea on how to create map for this game, but the work are too tedious. I need help so that I make the most efficient way in generating/editing the 2D map. 

 

If you are good at this, please help a newbie out :)

Share this post


Link to post
Share on other sites

Yes! But actually, I was inspired by this iPhone game: http://www.undercroft.com/

 

Looking at Legend of Grimrock and comparing it to Undercroft, Legend of Grimrock looks more "3D-like" rather than 2D, which is far beyond my what I want to do. I think, if not mistaken, Undercroft is more simple at that. So my prototype of 2D first person world should be below the standard of that of Undercroft.

Edited by Meerul264

Share this post


Link to post
Share on other sites

If you want efficiency in making levels, you need a dedicated tool - you need to program a level editor.

 

For this 2D POV dungeon-crawler you can make something simple based on diagrams. Each node in the diagram represents a place that the player can move to. Each node has four directions, each direction being a screen. So at each node the player can turn around and decide which way to go.

If you move 'forward' on a certain screen, it'll lead to another place\node on the diagram.

 

It's very important that-

A) You have this editor showing you thumbnails of each of the 4 direction screens per node.

B) This editor allows you to playtest a level quickly so you can go back and fix whatever's necessary.

Share this post


Link to post
Share on other sites


If you want efficiency in making levels, you need a dedicated tool - you need to program a level editor.

 

Thanks for bringing up that idea.

Though, to me, that sounds complicated. I've never program any editor before. Do you have any recommendation of tutorial on how to make such program, or any said editor program that is free?

Share this post


Link to post
Share on other sites

It's a very interesting assignment, and it's not that hard once you understand what you have to do.

But anyone who follows a professional methodology will recommend that before you make something from scratch, you look for something that can do the job already.

I'm not familiar with any dungeon-crawler SDK, but then again I'm not particularly knowledgeable in this genre. Maybe in some dungone-crawler enthusiast forum, or modding an existing game with mod tools?

If you work on an editor and engine and make them good enough, they may even be desired by other people such as yourself that want to make a game with this style.

 

In any case, you've never programmed an editor before. It's a GUI app, like MS-Paint, Notepad, Word, Excel - that is, it's an application that has an interface built with the OS's GUI controls (menus, panels, buttons, checkboxes, spinners).

In your case, along with all your menus and buttons etc. you'd also want to have an OpenGL 'canvas' control that you use with SFML to render your editing area - that diagram and nodes discussed before, with thumbnails etc.

 

First you design your application with pen and paper, away from the keyboard. You write\sketch how you want your editor to look, what kind of menus and buttons it'll have and how it'll work for editing.

Once all the design is in place, you need to implement it in actual software. For this you can pair up QT with SFML - QT is a very good GUI library, comes with a lot of modules and has a visual editor for you to place controls and handle layout. There should be more information in the SFML community forums as well.

Edited by Kryzon

Share this post


Link to post
Share on other sites

if you already have gui components in the game, you can use them to build the editor, and avoid having to deal with 2 gui api's for the project (or having to learn windows app programming as well as your graphics API). also that way you can build the editor into the game itself. while there may be circumstances where a stand alone editor is desirable, its often easier, and provides more functionality, to build an editor into the game, or as a link-able module.

Share this post


Link to post
Share on other sites

a linkable module is basically a library or hunk of code that you can link into an app like a library or DLL.

 

technically, .lib, .obj, and .dll (and the like) are linkable modules.

 

as an example: 

the modeling and animation tool for CAVEMAN was originally a built-in editor in the game. At the time it was easier to build it into the game than as a stand alone app. Later, i wanted to use it in Airships! So i put it in its own .cpp file with it's own .h file. now its a module that can be linked into any c++ app.

 

putting it in its own module was not 100% clean cut. the game must supply a mouse pointer texture ID, a yardstick texture ID, and a cube mesh ID to the module. the game is responsible for providing those assets. the game and modeler both use the same underlying mesh. texture. model, and animation databases and code library.

Edited by Norman Barrows

Share this post


Link to post
Share on other sites

Here is how i would do it:

 

use the doom engine (already published with source code for many different platforms and api's) and adjust the movement there "blockwise" as in a dungeon crawler.

The advantage is that you can already use very good level editors and in the future you could also create non-square level parts.

Share this post


Link to post
Share on other sites


If you want efficiency in making levels, you need a dedicated tool - you need to program a level editor.

 

No you don't.

 

If you want efficiency in making levels, you need to use an off-the-shelf editor, it will get you to a better level of functionality sooner. There are heaps of tilemap editors, and this game is mostly just a tilemap with various objects and metadata. It should be doable with minimum of custom code.

 

In order of preference:
 

* Use an existing editor

* Code a wrapper for existing code

* Code a plugin for existing editor

* Write your own editor

 

You'll have a lot more productivity if you use an existing editor, unless you have, say a team of at least 2 people fulltime generating content. And if that's the case, you won't be wasting time posting on gdnet.

Share this post


Link to post
Share on other sites

If you want efficiency in making levels, you need to use an off-the-shelf editor

Hi. With that you will be efficient in making the level editor itself, not the actual content. Using something off-the-shelf is not a guarantee of efficiency. You will definitely save work from recycling the UI, navigation, I\O etc. but depending on the paradigm of the editor one chooses to extend, he would have so much work as to entitle making your plugin a standalone program in the first place - especially if it goes in a different direction than what the editor is intended for. The OP does not need refined functionality, but a convenient way to layout screen data.
 
Which leads to the following...

There are heaps of tilemap editors, and this game is mostly just a tilemap with various objects and metadata.

I don't think that is the style of game he wants to make. It's a 2D, first person dungeon crawler. Something like the following:


2ce6zk5.gif

 
It's not a third person dungeon crawler.
If it were a tile-map game like that, he could indeed use one of the several tile-map editors available online (MapEditor for example).
Given that the style he's going for is very niche, I think a custom solution is, most likely, best.

Share this post


Link to post
Share on other sites

Generally, you would use RayCasting to achieve this.

 

The maps are simply arrays of tiles (like in a 2D RPG).

 

Some implementations:

 

A simple tilemap which would be stored in a text file.

# Each number corresponds to a different tile
1 2 3
0 2 1
3 0 2

More often, people use dedicated file types for the task. I'll let you learn about those.

Edited by superman3275

Share this post


Link to post
Share on other sites

This topic is 1592 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this