MHGen - Tool for automatically place monsters on Monsterhunt map

Tutorials and discussions about Mapping - Introduce your own ones!
Buggie
Godlike
Posts: 2743
Joined: Sat Mar 21, 2020 5:32 am

MHGen - Tool for automatically place monsters on Monsterhunt map

Post by Buggie »

MHGen - Tool for automatically place monsters on Monsterhunt map

Tool not pretend to be silver bullet. After placement monsters usually need additional work with it.

Usage:
1. Open in UnrealEd v469 MHGen.u
2. Use new button appear as brush builder.

Or as usual (v436):
Add it to EditPackages.

Install:
unpack into System

Settings:
Scale - float number which scale probability placement monsters on level. Default 1. If too many monsters - set it to 0.5 or 0.25.

Hunt:
If you need prepare really big map, but you see crash about runaway limit - run UnrealEd with param -norunaway
MHGen.zip
(15.45 KiB) Downloaded 5 times
Last edited by Buggie on Tue Feb 20, 2024 9:25 pm, edited 18 times in total.
User avatar
OjitroC
Godlike
Posts: 3638
Joined: Sat Sep 12, 2015 8:46 pm

Re: MHGen - Tool for automatically place monsters on Monsterhunt map

Post by OjitroC »

Buggie wrote: Wed Mar 30, 2022 1:33 pm If yo need prerpare really big map, but you see crash about runaway limit - run UnrealEd with param -norunaway
Yes, that worked.

Useful tool - got 900+ monsters in a 'clean' version of EUX2's LavaGiant - which is playable for me using Counter Strike weapons, given the geographical spead of the monsters and the size of the map. Got runaway loop crashes in a pathed version of XV-DarkForest until I used the -norunaway flag - at a scale of 0.5 I got 5666 monsters - not a criticism of the tool but an illustration of the need to 'tweak' the scale more than once to arrive at a reasonable number of opponents.
Buggie
Godlike
Posts: 2743
Joined: Sat Mar 21, 2020 5:32 am

Re: MHGen - Tool for automatically place monsters on Monsterhunt map

Post by Buggie »

On wide area scale must be less from 1. I use 0.25 for Resurrection map.
But tool initially test for DesertStorm map, where 1 be fine. Anyway I can tune it in some way.

maybe Later I change defaults.

Also each time placement and monsters set different. So you cna call it few times for get more interested set, for example.

About runaway limit - iI not able limit it fully, but work for reduce this counter usage where it possible.

Also I work on support maps which consist from few parts joined via teleport. Currently It not really work with it.

Also tool mostly targeted to my way place stuff on map. Possible some MH maps done in other way and this make experience worse.

All of it subject of modification for next version.
User avatar
sektor2111
Godlike
Posts: 6411
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: MHGen - Tool for automatically place monsters on Monsterhunt map

Post by sektor2111 »

OjitroC wrote: Wed Mar 30, 2022 3:19 pm
Buggie wrote: Wed Mar 30, 2022 1:33 pm If yo need prerpare really big map, but you see crash about runaway limit - run UnrealEd with param -norunaway
Yes, that worked.
EXACTLY what I wanted here
viewtopic.php?f=5&t=14672&p=130095
and was not "silver bullet" - now it is "gold bullet" :lol2:
That option/switch is there with reasons, I'm happy to see people finding it useful and... being agree with me - better later than never.

Builder feedback - probing only
- MeltTown = 4600+ Monsters added - a bit over Engine boundaries
- FloorWays - ZERO monsters added

A Little self thinking - I think PathNodes from Map can be used as guide for Monsters placement. In FloorWays PlayerStarts are placed like that with a logic or... multiple logic reasons. Explaining them is off-topic.
Buggie
Godlike
Posts: 2743
Joined: Sat Mar 21, 2020 5:32 am

Re: MHGen - Tool for automatically place monsters on Monsterhunt map

Post by Buggie »

- fix falling code for scout.
- allow travel on teleports.
- optimized code for less produce runaway crash.

Updated at first post: viewtopic.php?f=5&t=15125
User avatar
sektor2111
Godlike
Posts: 6411
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: MHGen - Tool for automatically place monsters on Monsterhunt map

Post by sektor2111 »

Endless execution.

And this section claims compiling error

Code: Select all

function bool FillMap() {
	local Scout scout;
	local PlayerStart PS;
	local ScriptedPawn SP;
	local MHGSpot Spot, Near, Last, Skip[MAX_SPOTS_COUNT]; // It works only with 16384 written directly
Buggie
Godlike
Posts: 2743
Joined: Sat Mar 21, 2020 5:32 am

Re: MHGen - Tool for automatically place monsters on Monsterhunt map

Post by Buggie »

For me all work fine
ScriptLog: Added 1331 monsters.
Used 48505 / 48505 spots in 17 levels.

Automatically merged

- Add debug option.
- Improve walk on level.

Updated at first post: viewtopic.php?f=5&t=15125

Automatically merged

- Not use scale for spawn protectors.
User avatar
sektor2111
Godlike
Posts: 6411
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: MHGen - Tool for automatically place monsters on Monsterhunt map

Post by sektor2111 »

Works only in 469b. In other case it goes in endless loop.
I'm going to deactivate builder as long as I only did tests, in my maps or edited maps I'm adding monsters manually and... using Factories.

Thank you for hints used in these assets.
User avatar
OjitroC
Godlike
Posts: 3638
Joined: Sat Sep 12, 2015 8:46 pm

Re: MHGen - Tool for automatically place monsters on Monsterhunt map

Post by OjitroC »

Don't know what happened here - I came across a virtually empty MH-LavaGiant on medor's site and ran MHGen on it - scale 0.1 that generated about 150 monsters.

Went to play the map - it crashed the game on starting the map - got the following in the log - first about 1MB of

Code: Select all

Warning: Type mismatch in Level of MHGSpot: file 5, class 2
Warning: Skipping 1 bytes of type 5
and then

Code: Select all

Critical: appError called:
Critical: Assertion failed: GetLevel()->Actors(0)==Level [File:UnScript.cpp] [Line: 222]
Critical: Windows GetLastError: Not enough memory. (8)
Exit: Executing UObject::StaticShutdownAfterError
Exit: Executing UWindowsClient::ShutdownAfterError
Exit: UGalaxyAudioSubsystem::ShutdownAfterError
Log: DirectDraw End Mode
Exit: UOpenGLRenderDevice::ShutdownAfterError
Critical: AActor::InitExecution
Critical: (MHGSpot MH-LavaGiant.MHGSpot0)
Critical: BeginPlay
Critical: UGameEngine::LoadMap
Critical: LocalMapURL
Critical: UGameEngine::Browse
Critical: ClientTravel
Critical: UGameEngine::Tick
Critical: UpdateWorld
Critical: MainLoop
Buggie
Godlike
Posts: 2743
Joined: Sat Mar 21, 2020 5:32 am

Re: MHGen - Tool for automatically place monsters on Monsterhunt map

Post by Buggie »

Weird. i try fix it. Update on first post. Try use it again.
User avatar
OjitroC
Godlike
Posts: 3638
Joined: Sat Sep 12, 2015 8:46 pm

Re: MHGen - Tool for automatically place monsters on Monsterhunt map

Post by OjitroC »

Buggie wrote: Fri Apr 01, 2022 2:48 pm Weird. i try fix it. Update on first post. Try use it again.
Same result, I'm afraid, same crash. It seems to me that the MHGSpots are now being saved in the map - which they weren't before.
Buggie
Godlike
Posts: 2743
Joined: Sat Mar 21, 2020 5:32 am

Re: MHGen - Tool for automatically place monsters on Monsterhunt map

Post by Buggie »

It can be saved only if you turn on bDebug. By default it off.
Right click on MHGen button and set it to false if it true.
User avatar
OjitroC
Godlike
Posts: 3638
Joined: Sat Sep 12, 2015 8:46 pm

Re: MHGen - Tool for automatically place monsters on Monsterhunt map

Post by OjitroC »

Buggie wrote: Fri Apr 01, 2022 3:43 pm It can be saved only if you turn on bDebug. By default it off.
Right click on MHGen button and set it to false if it true.
Oh ... yes, I had turned it on - didn't realise what the result would be. Everything works fine now :tu:

Automatically merged

A nice refinement of this tool would be the ability to choose to exclude certain 'monsters' - so, for example, in placing monsters in a map intended to be played with XVehicles it is, to a large extent, pointless to have flies, mantas, pupae, etc - basically those monsters without a ranged attack as they are unable to cause damage to tanks (or helicos?). Of course, it is still fun to run over those monster types or to slice them up with the helicos but, nonetheless, the ability to exclude specific monsters could be useful?
Buggie
Godlike
Posts: 2743
Joined: Sat Mar 21, 2020 5:32 am

Re: MHGen - Tool for automatically place monsters on Monsterhunt map

Post by Buggie »

You can always, after generation, select one pupae, via context menu select all pupaes and press delete.
Repeat same for mantas, or flies, if need.
For this not need any settings.

If you want biggest density - set scale bigger, and after remove not need monsters - you get what you want.
Buggie
Godlike
Posts: 2743
Joined: Sat Mar 21, 2020 5:32 am

Re: MHGen - Tool for automatically place monsters on Monsterhunt map

Post by Buggie »

- Fix placement for tentacles.
- Fix check collide on place monsters.
- Fix placement ground monsters.

Updated at first post: viewtopic.php?f=5&t=15125
Post Reply