PDA

View Full Version : Proof of Concept: 5 Choices (let's hold a contest?)



Argonil
September 15th, 2020, 00:04
I made a proof of concept that's attached below for a map that I want to see realized by a more experienced mapmaker than me. I got this idea of letting each Keeper choose which 5 creature types that you want to be able to attract for the rest of the match. You get presented with a choice between 3 creature types, such as Warlock/Monk/Fairy. After having chosen 5 times you'll be able to claim your portal. In effect it's like having 5 bits which can have 3 different values, resulting in 3^5 = 243 possible combinations of creatures. I used the DRAWFROM() command to randomize which combination the enemy chooses, so it'll be different each time.

Here are the five choices you'll have to make:

Warlock
Monk
Fairy

Barbarian
Bile Demon
Giant

Mistress
Samurai
Wizard

Thief
Demon Spawn
Hellhound

Orc
Archer
Troll

And you always get Tentacles. Tentacles for everyone! :tentacle: :o


My main concern is balancing the map around the 4th choice. Hellhounds are good for rushing, Demon Spawn are decent early and good in the late game, and Thieves are bad early but really good in the very-late game. The current sandbox layout that I used for testing greatly favors rushing, i.e. picking hounds and samurai. There needs to be some terrain and some white enemies to deter you from rushing, so that all 3 options are viable. Maybe also add a neutral Vampire for the first who claims it to give early-game creatures a different advantage. Might also want each Keeper to have 1 gem face in their area which they have to cross water to get, and that water leads to long canals that stretch past the white enemies and possibly all the way over to the other Keeper's gem face, so that harassing imps with hounds or sneaking in with a thief is possible. But I doubt that I could realize it very well, so why don't we just hold a contest to see who can make the best 5 Choices map? Take the ideas that I mentioned as suggestions, nothing more. I'll give it a shot as well. I bet we'll end up with several great takes on it which will be worth keeping. In fact, they'll be better together as it gives the concept more replayability. :D

Btw, I couldn't get the scripting for a multi-player version to fit within the limits since I used 64/64 script value slots and 47/48 IF condition slots, so multi-player is not gonna be possible unless there's a much more efficient way to do it. But I think people mostly play single-player anyway?

*The script now only uses 24/48 IF conditions and 46/64 script values.


2066

YourMaster
September 15th, 2020, 00:45
I can't check right now, but if the KILL_CREATURE command works with PLAYER_NEUTRAL too, you could probably reduce your if statements if you don't check for action points, but instead place neutral units for you to claim instead. Then when you claim one unit of the set, kill the other ones. That way you don't have to check for the flags too.

Also, I don't think you need to set the PLAYER1 creature availability with the flags. You can change:


SET_FLAG( PLAYER1, FLAG0, DRAWFROM(1~3))

IF(PLAYER1, FLAG0 == 1)
CREATURE_AVAILABLE( PLAYER1, SORCEROR, 1, 30)
ENDIF
IF(PLAYER1, FLAG0 == 2)
CREATURE_AVAILABLE( PLAYER1, MONK, 1, 30)
ENDIF
IF(PLAYER1, FLAG0 == 3)
CREATURE_AVAILABLE( PLAYER1, FAIRY, 1, 30)
ENDIF


to



CREATURE_AVAILABLE( PLAYER1, DRAWFROM(SORCEROR,FAIRY,MONK), 1, 30)


I hope this helps.

Argonil
September 15th, 2020, 01:05
I hope this helps.

Certainly does, thank you. Although, I made it so that if the AI selects bile demons, trolls and mistresses, then he can attract 1 reaper once the temple is built. So I'd presumably have to use IF_AVAILABLE to check for them instead, but do I need to use 3 checks on that or can I include all 3 creatures in 1 check somehow?

YourMaster
September 15th, 2020, 01:08
You can use the ADD_TO_FLAG command for that. Say, flag5 = 3 gets you a reaper. Then just add 1 to flag5 for each of those units you claim.

Argonil
September 15th, 2020, 01:17
That's what I have already, it's built into my IF statements for the flags which I no longer need, so I might as well check the creatures with IF_AVAILABLE directly instead of setting up a flag which checks for it. I don't see why neutral units would be better, you would just have to check for the unit instead, and it requires an extra door to keep them contained, which extends the length of the room by 5 additional tiles. It's already long. I'd also have to set up a script which grants 1 of each unit the AI has chosen to him, to make it fair.

*Oh well, I can take the 3 IF statements since I save like 15 on the other thing you told me.

YourMaster
September 15th, 2020, 01:29
O yeah, for the human player you still have if-statements there where you could have the add_to_flag commands, but you said you wanted to give blue the reaper,.. I don't know how you could use less than 3 if-statements for that either.

For Red though, right now you check for each set for both a flag AND the action point. So that gives you 3x2 if statements. If you remove those, and for each set just check for the unit being there, and kill the others, you need just 3 if statements in total.

But, I guess you can also change this:



IF_ACTION_POINT(1, PLAYER0)
IF(PLAYER0, FLAG0 == 0)
CREATURE_AVAILABLE( PLAYER0, SORCEROR, 1, 30)
SET_FLAG(PLAYER0, FLAG0, 1)
QUICK_OBJECTIVE(​2,"Excellent choice. Here's the next set: West: Barbarian | Center: Bile Demon | East: Giant",ALL_PLAYERS)
ENDIF
ENDIF

IF_ACTION_POINT(2, PLAYER0)
IF(PLAYER0, FLAG0 == 0)
CREATURE_AVAILABLE( PLAYER0, MONK, 1, 30)
SET_FLAG(PLAYER0, FLAG0, 2)
QUICK_OBJECTIVE(​3,"Excellent choice. Here's the next set: West: Barbarian | Center: Bile Demon | East: Giant",ALL_PLAYERS)
ENDIF
ENDIF

IF_ACTION_POINT(3, PLAYER0)
IF(PLAYER0, FLAG0 == 0)
CREATURE_AVAILABLE( PLAYER0, FAIRY, 1, 30)
SET_FLAG(PLAYER0, FLAG0, 3)
QUICK_OBJECTIVE(​4,"Excellent choice. Here's the next set: West: Barbarian | Center: Bile Demon | East: Giant",ALL_PLAYERS)
ENDIF
ENDIF


to




IF(PLAYER0, FLAG0 == 0)

IF_ACTION_POINT(1, PLAYER0)
CREATURE_AVAILABLE( PLAYER0, SORCEROR, 1, 30)
SET_FLAG(PLAYER0, FLAG0, 1)
QUICK_OBJECTIVE(​2,"Excellent choice. Here's the next set: West: Barbarian | Center: Bile Demon | East: Giant",ALL_PLAYERS)
ENDIF

IF_ACTION_POINT(2, PLAYER0)
CREATURE_AVAILABLE( PLAYER0, MONK, 1, 30)
SET_FLAG(PLAYER0, FLAG0, 2)
QUICK_OBJECTIVE(​3,"Excellent choice. Here's the next set: West: Barbarian | Center: Bile Demon | East: Giant",ALL_PLAYERS)
ENDIF

IF_ACTION_POINT(3, PLAYER0)
CREATURE_AVAILABLE( PLAYER0, FAIRY, 1, 30)
SET_FLAG(PLAYER0, FLAG0, 3)
QUICK_OBJECTIVE(​4,"Excellent choice. Here's the next set: West: Barbarian | Center: Bile Demon | East: Giant",ALL_PLAYERS)
ENDIF

ENDIF


EDIT:
Another advantage of killing units, is that you can actually show the units people can claim, instead of having to tell them. Makes your map better for an international audience.

Have you seen the 'My Pet Dungeon (https://keeperklan.com/downloads.php?do=file&id=129)' map I made somebody a while back?
https://keeperklan.com/attachment.php?attachmentid=1780

I think you can steal a lot from there, and each time show the unit in the 3 boxes, as a pretty way to select stuff.

Argonil
September 15th, 2020, 01:44
Hmm, I don't understand the last part, checking for an action point and setting a flag which there aren't any checks for. Is that what you meant to write?

But I see you're right, it would save IF checks if I checked for the units and killed the others in the same check. Unfortunately I'd have to add equally many IF checks back again to give the AI one of each unit that he chose, to even the playing field. It'd take 15 ADD_CREATURE_TO_LEVEL commands as well, do they count for anything? Otherwise it could actually be worth it as I could bake the checks for the reaper into that.

Edit: Is ADD_CREATURE_TO_LEVEL or KILL_CREATURE a "script value" when placed inside an IF check? So much to keep track of...

YourMaster
September 15th, 2020, 01:52
You got it,... now you check a flag and an action point. Instead you check for a unit, and kill the unclaimed neutral units.

If you don't want to give red a head start, I guess you could kill the first red unit too, but not a very clean solution. So that code I posted above might also be a good idea, saves some if statements without actually changing any functionality.

Argonil
September 15th, 2020, 01:56
ohh, I didn't see the IF check it's all contained in. Right... thanks. :)

Argonil
September 15th, 2020, 03:44
I've uploaded the optimized script. It now uses 46/64 script values and 24/48 IF conditions, quite the significant improvement! Still not sure if there's enough script values to make a multi-player version, but it certainly frees up some space for the actual layout.