Merr_Random_Map

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Merr_Random_Map

Post by Merr »

I've spent the past few weeks writing scripts until I was blue in the face ...
My goal was to have a totally random map ...
I found the best approach that creates a random map and (most importantly) a playable random map!
Now, the map may not look "natural", but it's playable ...

I created terrain cards ...
Each card is a 5x5 mega tile ...
The cards are then placed in a list ...
The list is then put into a deck (array), then each card is randomly drawn and placed on the map in columns and rows.

Before I place the terrain, I randomly draw the main roads and streams(rivers) ... straight for now, I hope to have them logically wiggle.
My terrain cards support wiggling streams(rivers) but I haven't written the scripts yet.
Currently, it can support up to 2 roads and 2 streams (or 2 rivers).
Tracks are randomly drawn along each axis.
I built in support for "hills" when Pip allows us to script height increases.

I'm writing the scripts so that it can support any blank BAM with minimum size 20x20 ... screenshot shows 30x30.
The combinations are so many I can't imagine how many variations it can build.
The cool part is that anyone can build their own terrain "card" and add it to the list.

The screenshots show 2 Rural (no river) and 2 rural (river). Note that I don't have Objectives ... I'm planning on having Random Missions with Random Objectives based on the mission selected. Also, I'm using Pip's CarryOver units to compliment the whole thing. When I'm done, it will be all thrown together into a Random_Campaign !

Rural Crossroad (no river) - 1
Image

Rural CrossRoad (no river) - 2
Image

Rural CrossRoad (rivers) - 1
Image

Rural CrossRoad (rivers) - 2
Image

I hope you agree ... otherwise write your own! :P

Many thanks for looking,
Rob
gollummen
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 72
Joined: Wed Nov 24, 2010 1:00 pm

Post by gollummen »

It looks great!

Random maps would be a very cool addition.
If you make more mega tiles that look a bit more "messy" then I think you could have a very nice result.
Great work.
IainMcNeil
Site Admin
Site Admin
Posts: 13558
Joined: Fri Apr 01, 2005 10:19 am

Post by IainMcNeil »

Very cool :)
pipfromslitherine
Site Admin
Site Admin
Posts: 9922
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Using built tiles in this way was one of the solutions I am investigating here as part of our future random system, so it's definitely a valid approach. Amaris went for a system where he constrcuts a number of known elements I think. Each one gives you something different for sure. Will be awesome to see what you guys end up with!

As always, give me a yell if you run into any issues.

Cheers

Pip
Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Post by Amaris »

Very impressive! Extremely symmetrical :wink: but great for MP :D
madasaskaven
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 32
Joined: Fri May 28, 2010 3:50 pm

Post by madasaskaven »

I love the look of these any news on when they will be available it will make multi play games even better.

Mick
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

You know gentlemen ... I'm suprised this works for MP games !

I just ran some tests in hotseat and it works ... but, I'll need to tweak some stuff, mostly because the players can't redeploy their forces and they might get trapped on the first turn.

Things I need to do ...
- Redeploy Forces.
- Adjust VP's to fit the terrain cards.
- Adjust map generation parameters to remove traps.
- Create Random Force Scenarios.

I'm borrowing Pip's great new MP_Beta logic so I hope to have at least two scenarios.
I hope to include the Random Mission script ... attack/defend/meeting engagement.

I've got new terrain ... Mud, Brush, Orchards, and Fords. Fords were still broke in BA so it's not new, but fixed.

I'm going to work on this over the next few days. At least it works, but it needs to be playable.

Basically, it's going to be my B.O.C. scenario .... Box Of Chocolates ... you never know what you're going to get! (Forrest Gump).
Besides ... the maps look like a box of chocolates anyway :wink:
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

With Pip's help making me "globally aware" :wink: ... I now have added a strategic element to the random B.O.C. ...

Now, some might think this is "gamey" since assets like artillery and air support can generally be called in without any trouble, however, it's a concept to liven up the MP experience.

In the screenshots below, the RED circles are VP's, BLUE boxes are the starting deployment zones.

.....................

CrossRoads using 36 terrain cards on a 30x30 map
Image

As you can see above, the first turn starts with the Allies having a slight advantage of 3 VP's with an AirStrike asset.
The Germans only have 2 VP's in their deployment zone, but one of them is the AidStation.

.....................

CrossRoads using 56 terrain cards on a 30x30 map
Image

Note that I'm using 56 cards, which added more variety to the terrain but there is no FO OutPost ... so Artillery support for both sides are unavailable.
Also, the Germans have a VP advantage on the first turn, with Air Support !

.....................

In conclusion, there will always be 4 VP's minimum (main crossroad and exit road locations), with up to 11 VP's currently possible.
I'm going to create a Reinforcement script that will help the slight imbalance to the starting VP's, because if a player has more VP's than his opponent he might assume a defensive posture, which is generally a better posture.

I hope you like the concept, however, it's not mandatory .... The player can swap out my BONUS with the Slith default bonus in the editor.
pipfromslitherine
Site Admin
Site Admin
Posts: 9922
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Wow. Can't wait to see these random mods out there being played!

Cheers

Pip
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

Ok .... A quick update .... I'm ready to get a BETA out the door, v.86.

I've got a new Bonus Asset ..... ParaDrop Raid .

This is a "lite" version of my original design from this thread ... viewtopic.php?t=21129
This doesn't include the drama of the C47 and a big drop mission ... A simply drop marker (yellow smoke), a bomber sound (same as b17/he11 strike), then one chute .... with 3 units deployed.

Currently, the ParaDrop has the following attributes ...

- Must own the AIRFIELD.
- Total of 9 airborne units available (in 3 groups of 3).
- Can drop 3 units anywhere on the map.
- 1 Turn arrival delay.
- No delay between drops, ie once the first drop arrives you can assign another drop (which, of course, takes 1 turn to arrive).

It's pretty cool. Thanks to Junk2Drive for his private comments back when I did the original drop ... This allowed me to fix the bugs and clean up the code ... which, btw, is easier to ammend with little fuss (I think so, compared to my ugliness earlier).

Stay tuned ... Hopefully I can have a MultiPlayer BETA out today!
pipfromslitherine
Site Admin
Site Admin
Posts: 9922
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

You spoil them with your delicious mods!

Looking forward to it! Once the 1.5.5 update it out of the way, I will try and get the two awesome random map mods into the download section - provided you guys are happy with them :).

Cheers

Pip
Post Reply

Return to “Battle Academy : Modders Corner ”