A Game Editor


I whipped up the beginnings of a game editor today. I know its not traditional for roguelikes to have editors, but I have felt the requirement in terms of building special rooms (prefabs), testing layouts, lighting, etc.

It’s not much yet. All I can do is draw tiles on the map, but it’s a start.

Game Editor

I envisage the editor to allow me to configure dungeon layouts, light sources, skills, races, etc. Basically it should become the editor for all the customisable content in my game.

I had to jump through some hoops to get it to work with XNA, but in the end it wasn’t too hard. There are some nice articles on rendering XNA output onto a panel as seen above. The grid lines were also quite tricky. I basically ended up drawing a 1×1 pixel texture across the render window to form the grid lines. (yes there is no native 2D line drawing support).

I envisage the design to use a Model-View Presenter architecture (MVP) with the actual editor form making updates to the model through a presenter class. My XNA main loop will render the model in whatever state it is. No decisions will be made in the XNA portion of the code. I find it helps me to separate the rendering of game graphics from the actual game data.

Advertisements

2 thoughts on “A Game Editor

  1. I just dropped in to say I enjoyed your dungeon creation articles, but I’m commenting with a rather off-topic question: where does the wonderful theme gracing your screenshot come from?

    I’ll keep reading your blog, as someone who always wanted to learn about making games, it will surely prove handy!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s