Sign in to follow this  
boasfesta

Automapper System Sourcecode (VB6)

Recommended Posts

Hello!

Before anything, sorry for my bad english :( 

My name is Lucas Tardivo, nicknamed boasfesta ;)

Im here to release my new system, i think no one did nothing similar before and i think will be very useful aswell, so i develop a automapper system on server that make a lot of maps on your game and connect its teleports, finishing with a big and beautiful island!

The system doesnt make a game at all, cause if he dids we doesnt need more game developers anymore hahaha. It just make a lot of beautiful maps, gaining a lot of time, just leaving for the developers some details, cities, bridges and caves(for now, maybe in a future update... hahaha).

The system intention is to make islands in a really small time, so developers can go in game and check if the result is on a perfect format for their game. In my last test, a Core i5 8gb ram notebook make 100 maps (100x100 each) in 140secs, to be more specific, this is an graphic with 50x50 maps results.

All graphic resources are configurable easily inside code ;)

nYxr63w.png

Automapper System

 

Features:

  • A form with all configuration things and time information
  • Island model maker
    • It makes a rectangle island with configurable size (4x4 maps, 5x5 maps, etc...) also map size (50x50 tiles, 80x80 tiles...). The system automatically makes coasts/beachs, and inside the island it makes exclusive features like mountains, paths and rivers. The beachs size in coasts its configurable too.
  • Map small details (Flowers, rocks...)
    • They appear in whole island and can be configured on Sub LoadDetails.
  • Tall grass
    • Autotile it and place in every map.
  • Paths
    • It starts on center map so odd total maps works better, the paths goes along the island having 75% chance of changing direction after every map, it stops when find a coast or beach.
  • Rivers
    • A random number of rivers is set and then they are placed on a random inside map (not coast map), when the river born it have a fixed size along the all river and 5% chance to change direction every step (the river never goes up, just left, down and right).
  • Mountains
    • Mountains doesnt have autotiles, so i make a simulation on server. Every inside map have a random number of mountains depends on its grass count, the mountains are placed just on grass (avoiding rivers and paths) and have a random size. After set a mountain place the system start to map it like a autotile.
  • Resources
    • Easily configurable and it is placed on whole grass island, including mountains but avoiding paths and rivers.

 

The system automatically insert:

  • Blocks on rivers, mountains and similars
  • Teleports between maps

 

Some notes:

  • The download include a client folder just for a instant test if you like to, but all system remains on server.
  • The system have 99% precision, but it doesnt discard human interaction to fix some things and make your maps get better and better (Remember, the system its just a machine, it doesnt thinks, it just do!)
  • For add this system, your engine must be a DX8 Engine made on VB6, that support autotile system, such as Skywire and similars. The system was developed on a Skywire engine v5 and works perfect on every version.
  • Avoid island smallers than 4x4 maps and bigger than 10x10

 

Installation Guide:

  1. Open your server side on VB6
  2. Click Project->Add Form
  3. Select Existing
  4. Select the frmAutomapper in src folder
  5. Click Project-Add Module
  6. Select Existing
  7. Select the modAutomapper in src folder
  8. Create a CommandButton in frmServer
  9. Click on it twice
  10. Add the follow code on it: Call OpenAutomapper

Also, there is a instructional video on download page.

 

Configuring your automapper

By default, the package contain an already configured automapper for the instant test, but you can easily configure it as you want!

 

Tileset Configuration

The automapper does not know what tiles to use, so you need to specify them. This is a good way to make another island types as desert islands and snowy islands!. To configure your tilesets, click on Automapper form: Configuration->Tilesets.

The first thing you need to know about automapper its that works with tileset prefabs, for example, the Water prefab. For apply them to map you'll need to find the water tile, an autotile by prefference. Then inform the water graphic tileset number, its X and Y position, and if its an autotile, his autotile type. Also give attemption for what layer you're filling on, Water prefab works better on Ground, but mountains and overgrass must be Mask 1. Don't forget that an prefab can have more than a layer, so avoid to get undesired results.

To setting tilesets X and Y you must always inform the first left superior tile, so the automapper can find the whole tile with autotile information (For example, an simple autotile vx its 3x2 area, and a normal tile its just 1x1). If you want to see more exactly the tileset coordinates, follow these steps:

  • Add an label on frmEditor_Map and rename it to lblSelected
  • Search for Sub MapEditorChooseTile, and add this line:
frmEditor_Map.lblSelected.Caption = "Tile:" & frmEditor_Map.scrlTileSet.value & "X: " & EditorTileX & " Y:" & EditorTileY & " A:" & frmEditor_Map.scrlAutotile.value

*Special note: Mountain tilesets doesn't have an autotile system by client, so the automapper must to implement it by server. Just be sure to select the first superior tile of mountain graphic, and the tileset must be like this model.

 8oV3YuC.png

 

Resources configuration

The resources can be configured on Configuration->Resources. All resources in the list will be random placed on whole island.

 

Details configuration

Details are smaller graphics and abundant ones, so to get easy i made an sub that you can just insert the start x and y on the tileset and his end x and y of details area, so the automapper will do the whole work setting tilesets for them. Details always are placed on mask 2 layer. To configure your details just open the modAutotile on Sub LoadDetails.

For add new details area, insert a new code line: LoadDetail TilePrefab, Tileset, StartTilesetX, StartTilesetY, TileType, EndTilesetX, EndTilesetY

Example: LoadDetail Grass, 16, 0, 0, TILE_TYPE_WALKABLE, 7, 7

Its the only source configured resource, but it was just annoying me to make an editor, i'll give a kiss for who make an editor for this <3


If you want to see more, check my album on imgur

 

This system os totally open source and with free distribution license, just keep the original credits ;)

 

Credits: boasfesta (Lucas Tardivo)

 

So then, here it is.

Download Automapper Sourcecode

 

If you liked, don't forget to leave a donation so i can keep buying coffee to make and release new systems like this!

Make a donation!

Edited by boasfesta
Added informations about mountains and tileset coordinates

Share this post


Link to post
Share on other sites
12 hours ago, Kasplant said:

Awesome work man! Very cool to see you made it open source!

Yeah, i always want to do some good things for communities like i normally did 8 years ago sending tutorials for Elysium engine hahaha. Its time to be a good guy again :) 

 

12 hours ago, jcsnider said:

Thank you so much for releasing this to the community! I cannot wait to dive in and see how it all works. *Donated!*

No! Thank you guys to recept me so good as you did ;) 

I promise that this won't be my only contribution for the community, its just starting 8) hahah

 

4 hours ago, Damian666 said:

awww... I have to work today, else I would be totally over this xD

Well, now it's open source so we have a lot of time! hahhaa

It will be a honor help you to convert this algorithm to Orion, Damian! I'm here for anything ;) 

 

Oh man im making these guys install VB6 again! I feel so special :P hahaha

Share this post


Link to post
Share on other sites
20 minutes ago, boasfesta said:

Oh man im making these guys install VB6 again! I feel so special :P hahaha

again?

 

I had it installed the whole time man :P

 

I'm converting it now, down to 80 errors and counting lol

Share this post


Link to post
Share on other sites
3 minutes ago, Damian666 said:

again?

 

I had it installed the whole time man :P

 

I'm converting it now, down to 80 errors and counting lol

 

Woooow damn! I did'nt thought VB.NET was so different! hahha

Very excited to see this working on a new engine :) 

Share this post


Link to post
Share on other sites

We are planning on some type of tool that might be able to create all kinds of areas automatically. (Dungeons, islands, forests, etc). This could very likely play a key role in such a system but it's not something we will be working on until the main engine and source have been released.

Share this post


Link to post
Share on other sites

Its not ground layer, you're painting the whole tile filling all layers, and not keeping the under layers just adding the above ones as the system does, probably this is happening because you're justing setting the map tile as the tile prefab, and the tile prefab doesnt have nothing on under layers :P. So the black border on your grass doesnt mean the tile its on ground, they are on mask 1 but there is nothing on ground. So in the addTile method you'll need to find the first tile prefab filling layer (like mask 1 for example) and then start to fill just after this layer (keeping the ground safe) for the not detailed prefabs as water and river, for the detailed prefabs as grass and mountains you have to keep the above layers too, so you just fill the layer that have an tileset and ignore the anothers.

 

This code is on Sub AddTile and explains exactly what to do:

    For i = 1 To 5
        If Tile(Prefab).Layer(i).Tileset <> 0 Or CleanNextTiles Then
            TileDest.Layer(i) = Tile(Prefab).Layer(i)
            TileDest.Autotile(i) = Tile(Prefab).Autotile(i)
            If Not HaveDetails(Prefab) Then CleanNextTiles = True 'For water and rivers
        End If
    Next i

 

Share this post


Link to post
Share on other sites
1 hour ago, Damian666 said:

but I didn't touch anything of that O.o

 

I only made it work in vb.net...

 

xD

Well so there is something different in Orion autotile system, i will install VB.NET on my pc and check it out :P 

 

4 hours ago, jcsnider said:

We are planning on some type of tool that might be able to create all kinds of areas automatically. (Dungeons, islands, forests, etc). This could very likely play a key role in such a system but it's not something we will be working on until the main engine and source have been released.

 

@jcsnider@Kibbelz if you guys want to add the automapper system to Intersect i can make a conversion to C#, so it won't waste your time working on a done system and you can work in new ones. Will be good to help me study it and will be a honor have my system on a official Intersect release :) 

Share this post


Link to post
Share on other sites

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