Designing a Base from Templates

Using a text file to design your base

Information and discussion for custom maps and mods.
Post Reply
umairazfar
Posts: 92
Joined: Mon Sep 08, 2014 1:01 pm

Designing a Base from Templates

Post by umairazfar »

I wanted to make a single player mission for Dune 2000 and found the editor to be quite limited in a few ways. I might be doing something wrong, but I could not see the buildings for various factions that I could put down. This got me thinking and I thought that there should be a way by which the creation of single player map can be made easier. So I made this little project of mine.

The idea I got was, there should be a way by which we can make a base quickly, so I started with developing an algorithm that can generate a base. Later I realized that making a base from a text file will be even easier, so now the plan is to add functionality for both methods. I only spent 3 hours on it and the current version has some bugs, but it is working fine with the RA mod. Support for other mods will be added in due time and a separate algorithm will be written to create random looking bases in far future. So this is what you do.

First of all, you design a base using a text file. The file can have both *.txt or *.yaml extension.

Image

Then you open the software and enter the coordinates from where you want the base to be drawn. These are the top-left coordinates. Then, you load your file. The text is generated based on the base you defined, so press Ctrl + A inside the text box and Ctrl + C to copy the code.

Image

Then you open the map.yaml file where you want to add the code as I have done in this picture:

Image

Save the file and then just open the map to see your base in all of its glory

Image

The code will be improved in due time and will be kept free for anyone to use. If someone wants the software at its current build state, they can get it from here. Be warned that this is a very early build and has many errors.

Enjoy!

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

It is an interesting idea to use ASCII art to create maps. I hope we can integrate my new ingame-map-editor sometime in the near future. https://github.com/OpenRA/OpenRA/pull/4496

umairazfar
Posts: 92
Joined: Mon Sep 08, 2014 1:01 pm

Post by umairazfar »

In game map editor will be awesome. My reasons for doing this was the speed with which you can add content to the map. You design a base using text file and just keep the text file handy. just use it at any new map when you want.

Obviously this does not take care of bad tile placement and you need to be careful where you should put the base.

The way I will do it is to place my bases when I start to design the map and then build the map around them.

umairazfar
Posts: 92
Joined: Mon Sep 08, 2014 1:01 pm

Post by umairazfar »

btw, this is not only going to be ascii art. I will make a proper algorithm to creating different looking bases. Ascii art is just one way of making the base.

I also need to take care of calculating the tiles that each building takes. This might be an interesting knapsack problem as I see it

umairazfar
Posts: 92
Joined: Mon Sep 08, 2014 1:01 pm

Software Updated

Post by umairazfar »

Image

Software has been Updated

List of Updates:
  • File reading support has been provided for all the available mods. You however need to make the template using the appropriate legend for every mod.
  • The legend is displayed in the rich text box field when the software starts. You can use that to design your base
  • Different structures have different tile size, you need to take that under consideration when designing your base because this software does not do so
  • The code for creating a base randomly does not work. So do not use the "Generate" button
  • The pictures on the right change as you change mod and factions and also the kind of base that you want (Not implemented yet). This was done to make sure that you have selected the right mod and faction
  • Created your own faction? Does not matter, just type its name in the faction combo box and the code will take care of the rest
The latest build can be acquired from this link. I take no responsibility if it will cause a crash or is harmful to your computer. Use at your own peril. I however have no intentions of causing harm, so if something bad happens, it was just an honest mistake.

umairazfar
Posts: 92
Joined: Mon Sep 08, 2014 1:01 pm

Post by umairazfar »

For D2K mod, now it places concrete blocks first before building structures :D

Now work will be done for procedural base generation :D

umairazfar
Posts: 92
Joined: Mon Sep 08, 2014 1:01 pm

Post by umairazfar »

First test for procedural map generation... a few things need to be sorted out...

Image

I keep forgetting that tesla uses 2 tiles, that is why the base came out not too great

this test was done to have the walls at the right place

this is a small base template which is equally spread.. we can have horizontally and vertically spread bases and also medium and large base sizes.

The base template is also generated as a file, if you want to store it for later use

umairazfar
Posts: 92
Joined: Mon Sep 08, 2014 1:01 pm

Procedural generation online!

Post by umairazfar »

Here is a small Base that is Horizontally Spread

Image

Here is a Large Base that is Equally Spread

Image

Here is a Large Base that is Vertically Spread

Image

Now the Template file is also generated with proper time stamp so that you can use it for later

Only RA mod is done so far, but doing the rest should not be difficult

Oh and all the structures are randomly placed so having similar looking bases is a bit difficult

umairazfar
Posts: 92
Joined: Mon Sep 08, 2014 1:01 pm

Final Version

Post by umairazfar »

The final version for the software can be acquired from here

If you just want the executable and not the code, it can be found at this location inside the code

OpenRABaseTemplate\OpenRABaseTemplate\bin\Debug

You are free to use it as you may, change it, improve it and do what you like. Just give credit if you use/improve this software.

As always, this software is only to facilitate map creation. If it harms your computer, i am not responsible, so use at your own risk. I however have tried to keep it harm free in all honesty.

Post Reply