PDA

View Full Version : Sandbox for DK1 Level



Zyraen
June 10th, 2011, 05:42
Here's an idea for a "Sandbox" style level for DK1.

Basically you start with 4 gem faces and a portal and can build everything. You can generally attract any Creature you like, except the usual - Ghosts, Skeletons, Vampires, Horned Reapers - you get them through applying your rooms.

There is 1 Hero Keep and 2 Keepers. Within the Hero Keep is the Avatar who you need to defeat / kill to win. Both Keepers do not have Bridge nor Scavenger Room, so you can effectively ignore them.

The map is separated into 5 portions, all separated by Lava

1) Your Area - The Biggest South portion stretches an area of about 30-40% of the map, and is basically your turf to build as you please. At the 2 far ends are 2 Hero Gates, ie Southwest / Southeast. Your Gems are closer to the Southeast Hero Gate.

2) Enemy Keepers - The East and West sides, stretching to the Northeast and Northwest, are occupied by Enemy Keepers. They each have 2 gem sides to mine for sustenance. Both Keepers cannot build Bridge nor Scavenger Room, and need not be killed to win the game.

3) Hero Keep - on the "opposite" North side of the map. Basically 1 small room for the Avatar and his bodyguard, 2 large rooms on both sides for the defensive parties, each room having an Increase Level. These 3 rooms are all locked, and there is another "external" room with a functional Hero Gate and Gems and some shooting areas.

4) Central - A very large block of dirt (probably about 10%-15% of the map area), with two Gem sides in the middle. Its basically North of your Turf, between you and the Hero Keep, and also between the 2 Keepers. Basically, a central staging ground.

Apart from your own section, all the other 4 sections have 2 gem faces. This is just meant as a reward if you choose to "hold" the area, which isn't difficult. You won't need these Gem faces anyway, since at 4 Gem Faces you won't run out of gold.

None of the Keepers nor the Heroes are allied. Being the sole builder of Bridges, you will be able to "direct" the fight in any way you please. This includes letting the Keepers fight each other, or bringing on a Hero Invasion upon the 2 Keepers and observing how they fare. In fact that is the purpose of the "Central" Block, to "encourage" competition.

To compensate for the inability to add Heroes / Creatures dynamically to your Sandbox level like in DK2, the following rooms serve as "settings" for the Hero spawns, but only at large room sizes :
- Barracks : determines the level of the Hero Spawns. the larger, the stronger the heroes.
- Temple : determines the frequency of Hero Spawns. the larger, the more frequent spawns will occur. Note that it defaults at Nothing, meaning the Heroes will Never Spawn to Attack you
- Torture Chamber : determines the spawning of Heroes with Tunnelers from the side gates on the same Southern area as you. The settings are Southwest (easier) or Southeast (harder) or Both Gates. Note that with Lava Traps its not difficult to block them off. Note the spawns are synchronised with the other spawns and follow the same timer as set by the Temple.
- Graveyard : determines the composition of the Spawns. It defaults to 5 man party that has more Melee and weaker Unit types, increases to a 6 man mid-difficulty party, finally a 7 man tougher Melee-Ranged blend. Generally, the larger the Graveyard setting the harder.

The first Room Settings generally only kick in at 26 tiles, followed by 30, then 35. In other words, you build a 5x5+1 block to change the first setting, then expand it by one row of 5 to change to the next setting. Of course any shape works, this is just for reference.

I chose the above room assuming that no one would Need to build them up to that kind of size to make use of the Rooms. Alternatively, would using less useful traps/doors like Alarm Trap, Poison Gas Trap, Wooden and Braced doors to adjust the settings be better?

The Hero's Total Creatures are generally capped at 100, separate from the 256 Creature Cap.
Note that even if there are no Hero spawns, ie your Temple is small, the Graveyard and Barracks settings will also affect the difficulty of your final fights. Not bothering to build up both rooms will make the final fight a general walk-over except for the Avatar himself.
Alternatively, you can build up all the rooms and kill 1000s of Heroes and convert as many as you like until the game stops producing more Creatures. You can also adjust it so that you keep capturing and converting powerful Hero units (and killing the rest, probably), so you can turn your whole army into nothing but Knights and Samurais if you so please.

Any general comments are welcome regards the interest and usability of such "Sandbox" settings? What would be the Portal Limit for the Keepers (yourself and your opponents) that would make it interesting? I was thinking of 40 35 35 for a start, or if the Player is at a disadvantage, 30,35,35

PS : for those wondering, I've started building the map in Adikted already. The script is still something I'm mulling over, hence this thread. Of course if there's no Sandbox DK1 market, then I'll just fit it as a Single Player map and drop the Sandbox Script.
This would merely mean more gold and no gems in the Player1 Turf, 4 gem faces in Enemy Keeper's area, removing some Lava for a landbridge to the centre, which would contain 2 gem faces (ie for you to hold). Plus the standard Room / Spell / Trap etc changes to make it challenging.

Update
This is what I've got so far. I don't think I'll change the layout from here, think it fits, but of course subject to User's feedback. Will be populating it and testing out the Scripts.
788

Update
The Map Script Content. Most of the comments inside are pretty straightforward.
It tentatively uses exactly 48/48 IFs. Sorry about the Lack of Indentation, if you want the actual TXT file I can send it to you.
Meantime, I will be Testing it before release

REM Sandbox Level. Kill the Avatar to win

SET_GENERATE_SPEED(400)

MAX_CREATURES(PLAYER0,30)
MAX_CREATURES(PLAYER1,40)
MAX_CREATURES(PLAYER2,40)

START_MONEY(ALL_PLAYERS,15000)

ADD_CREATURE_TO_POOL(BILE_DEMON,50)
ADD_CREATURE_TO_POOL(DRAGON,50)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,50)
ADD_CREATURE_TO_POOL(ORC,50)
ADD_CREATURE_TO_POOL(SORCEROR,35)
ADD_CREATURE_TO_POOL(HELL_HOUND,35)
ADD_CREATURE_TO_POOL(TROLL,35)
ADD_CREATURE_TO_POOL(DEMONSPAWN,20)
ADD_CREATURE_TO_POOL(TENTACLE,20)
ADD_CREATURE_TO_POOL(SPIDER,20)
ADD_CREATURE_TO_POOL(BUG,20)
ADD_CREATURE_TO_POOL(FLY,20)

CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,TENTACLE,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,FLY,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BUG,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,HELL_HOUND,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,1)

ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GARDEN,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,GRAVEYARD,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,PRISON,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TRAINING,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,BARRACKS,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,0)
ROOM_AVAILABLE(PLAYER0,SCAVENGER,1,0)
ROOM_AVAILABLE(PLAYER0,BRIDGE,1,0)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_OBEY,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SIGHT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0 )
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1, 0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1, 0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DESTROY_WALLS,1, 0)
MAGIC_AVAILABLE(PLAYER0,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_LIGHTNING,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_DISEASE,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_ARMAGEDDON,1,0)
MAGIC_AVAILABLE(PLAYER1,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_LIGHTNING,1,0)

DOOR_AVAILABLE(ALL_PLAYERS,WOOD,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,BRACED,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)

TRAP_AVAILABLE(ALL_PLAYERS,ALARM,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LAVA,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,BOULDER,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)

REM Computer Player stuff
COMPUTER_PLAYER(PLAYER1,0)
COMPUTER_PLAYER(PLAYER2,0)

REM Party of 5 - Samurai leading Barbarian, Giant, Fairy, Archer

CREATE_PARTY(ONE)
ADD_TO_PARTY(ONE,BARBARIAN,5,200,ATTACK_DUNGEON_HE ART,0)
ADD_TO_PARTY(ONE,SAMURAI,5,200,ATTACK_DUNGEON_HEAR T,0)
ADD_TO_PARTY(ONE,GIANT,5,200,ATTACK_DUNGEON_HEART, 0)
ADD_TO_PARTY(ONE,FAIRY,5,200,ATTACK_DUNGEON_HEART, 0)
ADD_TO_PARTY(ONE,ARCHER,5,200,ATTACK_DUNGEON_HEART ,0)

REM Party of 6 - Knight leading Samurai, Barbarian, Wizard, Fairy, Priestess

CREATE_PARTY(TWO)
ADD_TO_PARTY(TWO,SAMURAI,7,250,ATTACK_DUNGEON_HEAR T,0)
ADD_TO_PARTY(TWO,KNIGHT,8,250,ATTACK_DUNGEON_HEART ,0)
ADD_TO_PARTY(TWO,BARBARIAN,7,250,ATTACK_DUNGEON_HE ART,0)
ADD_TO_PARTY(TWO,FAIRY,8,250,ATTACK_DUNGEON_HEART, 0)
ADD_TO_PARTY(TWO,WIZARD,7,250,ATTACK_DUNGEON_HEART ,0)
ADD_TO_PARTY(TWO,WITCH,8,250,ATTACK_DUNGEON_HEART, 0)

CREATE_PARTY(FOUR)
ADD_TO_PARTY(FOUR,SAMURAI,10,500,ATTACK_DUNGEON_HE ART,0)
ADD_TO_PARTY(FOUR,KNIGHT,10,500,ATTACK_DUNGEON_HEA RT,0)
ADD_TO_PARTY(FOUR,BARBARIAN,10,500,ATTACK_DUNGEON_ HEART,0)
ADD_TO_PARTY(FOUR,FAIRY,10,500,ATTACK_DUNGEON_HEAR T,0)
ADD_TO_PARTY(FOUR,WIZARD,10,500,ATTACK_DUNGEON_HEA RT,0)
ADD_TO_PARTY(FOUR,WITCH,10,500,ATTACK_DUNGEON_HEAR T,0)

REM Party of 7 - Knight leading 2 Samurai, 2 Wizards, 2 Fairies
REM Note that at Level 10, everyone except the Knight can Freeze

CREATE_PARTY(THREE)
ADD_TO_PARTY(THREE,SAMURAI,7,250,ATTACK_DUNGEON_HE ART,0)
ADD_TO_PARTY(THREE,KNIGHT,8,250,ATTACK_DUNGEON_HEA RT,0)
ADD_TO_PARTY(THREE,SAMURAI,7,250,ATTACK_DUNGEON_HE ART,0)
ADD_TO_PARTY(THREE,FAIRY,8,250,ATTACK_DUNGEON_HEAR T,0)
ADD_TO_PARTY(THREE,WIZARD,8,250,ATTACK_DUNGEON_HEA RT,0)
ADD_TO_PARTY(THREE,WIZARD,8,250,ATTACK_DUNGEON_HEA RT,0)
ADD_TO_PARTY(THREE,FAIRY,8,250,ATTACK_DUNGEON_HEAR T,0)

CREATE_PARTY(FIVE)
ADD_TO_PARTY(FIVE,SAMURAI,10,500,ATTACK_DUNGEON_HE ART,0)
ADD_TO_PARTY(FIVE,KNIGHT,10,500,ATTACK_DUNGEON_HEA RT,0)
ADD_TO_PARTY(FIVE,SAMURAI,8,500,ATTACK_DUNGEON_HEA RT,0)
ADD_TO_PARTY(FIVE,FAIRY,10,500,ATTACK_DUNGEON_HEAR T,0)
ADD_TO_PARTY(FIVE,WIZARD,10,500,ATTACK_DUNGEON_HEA RT,0)
ADD_TO_PARTY(FIVE,WIZARD,10,500,ATTACK_DUNGEON_HEA RT,0)
ADD_TO_PARTY(FIVE,FAIRY,10,500,ATTACK_DUNGEON_HEAR T,0)

REM Avatar & Bodyguard. 2 Tiers only.

CREATE_PARTY(AVATARA)
ADD_TO_PARTY(AVATARA,SAMURAI,7,500,ATTACK_DUNGEON_ HEART,0)
ADD_TO_PARTY(AVATARA,AVATAR,10,5000,ATTACK_DUNGEON _HEART,0)
ADD_TO_PARTY(AVATARA,SAMURAI,7,500,ATTACK_DUNGEON_ HEART,0)
ADD_TO_PARTY(AVATARA,KNIGHT,7,500,ATTACK_DUNGEON_H EART,0)
ADD_TO_PARTY(AVATARA,KNIGHT,7,500,ATTACK_DUNGEON_H EART,0)
ADD_TO_PARTY(AVATARA,WIZARD,7,500,ATTACK_DUNGEON_H EART,0)
ADD_TO_PARTY(AVATARA,WIZARD,7,500,ATTACK_DUNGEON_H EART,0)

CREATE_PARTY(AVATARC)
ADD_TO_PARTY(AVATARC,SAMURAI,10,500,ATTACK_DUNGEON _HEART,0)
ADD_TO_PARTY(AVATARC,AVATAR,10,5000,ATTACK_DUNGEON _HEART,0)
ADD_TO_PARTY(AVATARC,SAMURAI,10,500,ATTACK_DUNGEON _HEART,0)
ADD_TO_PARTY(AVATARC,KNIGHT,10,500,ATTACK_DUNGEON_ HEART,0)
ADD_TO_PARTY(AVATARC,KNIGHT,10,500,ATTACK_DUNGEON_ HEART,0)
ADD_TO_PARTY(AVATARC,WIZARD,10,500,ATTACK_DUNGEON_ HEART,0)
ADD_TO_PARTY(AVATARC,WIZARD,10,500,ATTACK_DUNGEON_ HEART,0)

REM 11/16 Parties

REM Main Spawn Flag
SET_FLAG(PLAYER0,FLAG0,0)

REM Avatar Spawn Flag
SET_FLAG(PLAYER0,FLAG1,0)

REM Defensive Spawn Flag
SET_FLAG(PLAYER0,FLAG2,0)
SET_FLAG(PLAYER_GOOD,FLAG0,0)
SET_TIMER(PLAYER_GOOD,TIMER0)

DISPLAY_OBJECTIVE(909,PLAYER0)

REM Set the Spawns using the Barracks
REM Flag simply defaults as low and ends up at the highest possible flag.
REM This automatically downgrades the Flag when you reduce the Temple size
REM 0+5 = 5/48 IF used

IF(PLAYER0,BARRACKS < 17)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER0,FLAG0,1)
ENDIF

IF(PLAYER0,BARRACKS >= 17)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER0,FLAG0,2)
IF(PLAYER0,BARRACKS >= 25)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER0,FLAG0,3)
IF(PLAYER0,BARRACKS >= 30)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER0,FLAG0,4)
IF(PLAYER0,BARRACKS >= 35)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER0,FLAG0,5)
ENDIF
ENDIF
ENDIF
ENDIF

REM Timers to Trigger the Spawns. the Timer is initialised upon the Map starting
REM 3 Timer tiers of 40, 25, 15 corresponding to Temple Tiles 26 30 35
REM the Timer is always re-started at 40 mins
REM 5+8 = 13/48 IF used

IF(PLAYER0,TEMPLE >= 26)
IF(PLAYER0,TEMPLE >= 30)
IF(PLAYER0,TEMPLE >= 35)
IF(PLAYER_GOOD,TIMER0 >= 18000)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER_GOOD,FLAG0,1)
NEXT_COMMAND_REUSABLE
SET_TIMER(PLAYER_GOOD,TIMER0)
ENDIF
ENDIF
IF(PLAYER_GOOD,TIMER0 >= 30000)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER_GOOD,FLAG0,1)
NEXT_COMMAND_REUSABLE
SET_TIMER(PLAYER_GOOD,TIMER0)
ENDIF
ENDIF
IF(PLAYER_GOOD,TIMER0 >= 48000)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER_GOOD,FLAG0,1)
NEXT_COMMAND_REUSABLE
SET_TIMER(PLAYER_GOOD,TIMER0)
ENDIF
ENDIF

IF(PLAYER_GOOD,FLAG0 == 1)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER_GOOD,FLAG0,0)
IF(PLAYER_GOOD,TOTAL_CREATURES < 100)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER_GOOD,FLAG0,2)
ENDIF
ENDIF

REM Spawns by Trigger / Gate
REM Hero Gates
REM 1 - East of Avatar (def) / 2 - West of Avatar (def) / 3 - Main Assault Gate
REM 4 - West of Heart / 5 - East of Heart, nearer to Gems / 6 - Avatar Room
REM Action Points
REM 1 - entrance to HG1 / 2 - entrance to HG2 / 3 - entering Avatar Room

REM 3 - Main Assault Gate. This ALWAYS triggers so long the Spawn is Set
REM 13+8 = 21 IFs used

IF(PLAYER_GOOD,FLAG0 == 2)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER_GOOD,FLAG0,0)
IF(PLAYER0,FLAG0 == 1)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-3,1)
ENDIF
IF(PLAYER0,FLAG0 == 2)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-3,1)
ENDIF
IF(PLAYER0,FLAG0 == 3)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,-3,1)
ENDIF
IF(PLAYER0,FLAG0 == 4)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,-3,1)
ENDIF

REM added an extra 2 IFs inside (not included in above count of 8 IFs)
REM as a Hidden "Bonus", the Main Gate spawns the AvatarC party
REM if you have a Barracks more than 7x7

IF(PLAYER0,FLAG0 == 5)
IF(PLAYER0,BARRACKS < 50)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,-3,1)
ENDIF
IF(PLAYER0,BARRACKS >= 50)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,AVATARC,-3,1)
ENDIF
ENDIF

IF(PLAYER0,TORTURE >=31)
SET_FLAG(PLAYER_GOOD,FLAG4,1)
IF(PLAYER0,TORTURE >=36)
SET_FLAG(PLAYER_GOOD,FLAG5,1)
ENDIF
ENDIF
ENDIF

REM Gates 4 & 5 - Heart Gates
REM 21+12 = 33 IFs used

IF(PLAYER_GOOD,FLAG4 == 1)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER_GOOD,FLAG4,0)
IF(PLAYER0,FLAG0 == 1)
NEXT_COMMAND_REUSABLE
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-4,DUNGEON,PLAYER0,5,200)
ENDIF
IF(PLAYER0,FLAG0 == 2)
NEXT_COMMAND_REUSABLE
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-4,DUNGEON,PLAYER0,8,250)
ENDIF
IF(PLAYER0,FLAG0 == 3)
NEXT_COMMAND_REUSABLE
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,-4,DUNGEON,PLAYER0,8,250)
ENDIF
IF(PLAYER0,FLAG0 == 4)
NEXT_COMMAND_REUSABLE
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,-4,DUNGEON,PLAYER0,10,500)
ENDIF
IF(PLAYER0,FLAG0 == 5)
NEXT_COMMAND_REUSABLE
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,-4,DUNGEON,PLAYER0,10,500)
ENDIF
ENDIF

IF(PLAYER_GOOD,FLAG5 == 1)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER_GOOD,FLAG5,0)
IF(PLAYER0,FLAG0 == 1)
NEXT_COMMAND_REUSABLE
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-5,DUNGEON,PLAYER0,5,200)
ENDIF
IF(PLAYER0,FLAG0 == 2)
NEXT_COMMAND_REUSABLE
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-5,DUNGEON,PLAYER0,8,250)
ENDIF
IF(PLAYER0,FLAG0 == 3)
NEXT_COMMAND_REUSABLE
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,-5,DUNGEON,PLAYER0,8,250)
ENDIF
IF(PLAYER0,FLAG0 == 4)
NEXT_COMMAND_REUSABLE
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,-5,DUNGEON,PLAYER0,10,500)
ENDIF
IF(PLAYER0,FLAG0 == 5)
NEXT_COMMAND_REUSABLE
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,-5,DUNGEON,PLAYER0,10,500)
ENDIF
ENDIF

REM 1 & 2, the Defensive Gates. They always spawn together
REM 33 + 3 = 36 IFs used

IF(PLAYER_GOOD,FLAG2 == 1)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER_GOOD,FLAG2,2)
NEXT_COMMAND_REUSABLE
SET_TIMER(PLAYER_GOOD,TIMER1)
IF(PLAYER0,FLAG0 <= 3)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-1,1)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-2,1)
ENDIF
IF(PLAYER0,FLAG0 > 3)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,-1,1)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,-2,1)
ENDIF
ENDIF

REM Action Points 1 & 2, whichever occurs first, triggers the first "Defence"
REM 36 + 3 = 39 IF Used

IF(PLAYER_GOOD,FLAG2 == 0)
IF_ACTION_POINT(1,PLAYER0)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER_GOOD,FLAG2,1)
ENDIF
IF_ACTION_POINT(2,PLAYER0)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER_GOOD,FLAG2,1)
ENDIF
ENDIF

REM Action Point 3 triggers the Avatar & Defences
REM 39 + 3 = 42 IF Used
REM unlike most other commands, this occurs ONCE only

IF_ACTION_POINT(3,PLAYER0)
SET_FLAG(PLAYER_GOOD,FLAG1,1)
IF(PLAYER0,FLAG0 <= 3)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-1,1)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-2,1)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,AVATARA,-3,1)
ENDIF
IF(PLAYER0,FLAG0 > 3)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,-1,1)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,-2,1)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,AVATARC,-3,1)
ENDIF
ENDIF

REM If the Avatar is slain after being spawned, you win
REM 42+2 = 44 IFs Used

IF(PLAYER0,FLAG1 == 1)
IF(PLAYER0,AVATAR==0)
WIN_GAME
ENDIF
ENDIF

REM Beyond this are EXTRA things

REM This Timer Resets the "Defensive" Spawns every 10 Minutes.
REM It can easily be Bypassed simply by dropping your Creatures
REM 44+1 = 45 IFs Used

IF(PLAYER_GOOD,TIMER1 >= 12000)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER_GOOD,FLAG2,0)
NEXT_COMMAND_REUSABLE
RESET_ACTION_POINT(1)
NEXT_COMMAND_REUSABLE
RESET_ACTION_POINT(2)
ENDIF

REM Extra 2 IFs added to Main Gate, which may Spawn Avatar Parties.
REM 45+2 = 47 IFs used

REM Extra IF for Temple checking.
REM This is a pre-built Large Temple used for Testing the Timers

IF(PLAYER0, TEMPLE >= 1)
ROOM_AVAILABLE(PLAYER0,TEMPLE,1,1)
END

diggory
June 10th, 2011, 11:22
This sounds like a great idea. Would the enemy keepers be completely seperate from you? IE there is lava/impen rock between your building sections?

The idea of controlling hero invasion via rooms sounds like a resonable idea seeing as there is no in built way to trigger invasions. What other things can be used as triggers though? Proximity to the portal or claiming certain parts? Just wondered if there were proximity triggers in the sense that the closer you dig to the hero portals, the harder the stuff they spawn is?

I think the standard room/creature set is good (minus scavenger room as its just plain annoying). I would personally prefer the creature cap to put the player at a disadvantage as you can always bulk out your army with hero converts etc. but thats just me.

Let me know if you got a draft of this map ready, ill glady give it a shot and give feedback. :)

Duke Ragereaver
June 10th, 2011, 11:26
Sounds pretty cool if you could work that out. Can you keep this updated by posting a thumbnail of the progress, please?

Zyraen
June 10th, 2011, 12:48
This sounds like a great idea. Would the enemy keepers be completely seperate from you? IE there is lava/impen rock between your building sections?
Indeed. They are separated from you by Lava, and they have no Bridges. Horned Reapers and Dragons may run across, but they don't have scout or other irritating tendencies. Hellhounds might but you just have to Guardpost-off the lava areas. Anyway, they don't have the Scavenger Room, so... nothing to worry about. Unless Level 10 Flies scare you.


The idea of controlling hero invasion via rooms sounds like a resonable idea seeing as there is no in built way to trigger invasions. What other things can be used as triggers though? Proximity to the portal or claiming certain parts? Just wondered if there were proximity triggers in the sense that the closer you dig to the hero portals, the harder the stuff they spawn is?
My first idea was actually exactly that - to trigger spawns using points.
The main problem is toggling the invasion On/Off.
It is really not difficult to implement at all, just that in between the Spawn Timers, the Player doesn't really have Any Way of knowing whether he just Switched it On or Switched it Off. Alternatively, it could be a repeatable point where you drop a Creature at point X and a Party Spawns at the Hero Gate (nearby or far). Its a bit cheesy though, to be too predictable like that.


I think the standard room/creature set is good (minus scavenger room as its just plain annoying). I would personally prefer the creature cap to put the player at a disadvantage as you can always bulk out your army with hero converts etc. but thats just me.
As mentioned, no one else will have the irritating Scavenger Room, just Yourself. Of course you could always "Give" them a Scavenger Room if you want to be Scavenged.
I think I will put the Creature Limit at 30 / 40 / 40 then. Its not like those 40 Creatures will endanger you anyway, because they can't get to you.


Let me know if you got a draft of this map ready, ill glady give it a shot and give feedback. :)
Sure, gladly! I'm happily working on it :) The Script is also about 30% done.


Sounds pretty cool if you could work that out. Can you keep this updated by posting a thumbnail of the progress, please?
Thanks for the support. I will probably link up the script I drew up, when I'm done with it, since it can be used for any level.

My Greatest Challenge with the script is sadly the 48 limit of IF conditions, for DK1 Scripts.
I've Actually dropped from 4 Tiers of Levels to 3 Tiers now, basically default Levels 5, Medium level 7-8 and High level 10.
Likewise, also dropped from 4 Tiers of Timers to 3 Timers only - 40, 25, 15 minutes.

Zyraen
June 10th, 2011, 16:55
I have just updated the first post, including the Map :) I don't think I'll change it much, just be populating it and testing out Triggers.
Feedback is welcome though :) although I must add that I don't really intend to make a more complex Hero Keep.

diggory
June 10th, 2011, 17:33
Looks good from what little you can tell from those map shots. Couple of questions:

1) Are the player's gem blocks embedded in that gold seam to the east?
2) Is the player's portal initially blocked off?

Obviously follow this design on this level for now, but if you do anymore levels like this, the DK2 My Pet Dungeon (sandbox) mode generally doesnt have enemy keepers. However nothing wrong with a bit of a twist I suppose. :)

Zyraen
June 10th, 2011, 17:43
1) Yes your Gem Block is in that tiny seam. When you remove all the Gold Blocks, its a stand alone column with 4 sides :) mine away to your heart's content
2) Yes your Portal is walled off and unclaimed. (that's why its yellow, not red). The Enemy Keepers start with their portal claimed, but yours is different.

I caught your note in the other thread on Favourite Levels that Enemy Keepers require you to rush :) but these Keepers don't.
They can both have 40x level 10 Horned Reapers, just don't connect your bridge to them and they won't attack you.

Since unlike Standard DK levels, you don't have to kill them to win, you can
A) Just ignore them
B) Attack them if you like
C) link them with Bridges to Each other or the Hero Keep to the Keepers and enjoy the show

Tentatively, the Creature Pool is...
50 Bile Demons, Dragons, Dark Mistress, Orcs. I consider these the most popular creatures
35 Warlocks, Trolls and Hellhounds*
* - hey if you build the Scavenger Room before you have your Portal Max, I assume you want them for some inexplicable reason?
20 Demonspawn, Tentacles, Spiders, Beetles, Flies - I don't think you mind not having any of these

In other words, I don't think you will need to worry about your Enemies draining all the good beasties from the Pool.
Even if they do, with just 1 Creature and a Scavenger Room, you can drain them all to your side...
Alternatively, feel free to recommend increased Numbers for the Pool

diggory
June 10th, 2011, 18:05
What heroes you planning to have poking around the keep, besides the avatar in the centre?

Zyraen
June 10th, 2011, 19:15
The Keep is actually more or less empty. On the way to the 2 big chambers, there's 2 small Lava Pools where a Wizard 9 and Archer 8 will fire at you. There's a pair on both sides, so altogether these 4 are the only Hero Creatures that begin on the map.

When you enter either Chamber, BOTH chambers will spawn parties based on your configuration (Barracks & Graveyard).
The weakest and default party of 5 for this is a Samurai leading Barbarian, Giant, Fairy, Archer, all level 5.
The strongest party of 7 that will spawn are all level 10, a Knight leading 2 Samurai, 2 Fairies, 2 Wizards.

Finally when you reach the Avatar's room, he will spawn in with his bodyguard, as well as another wave of reinforcements enter from elsewhere.
The "weakest" default bodyguards are all level 7, 2 Knights 2 Samurai 2 Wizards.
The Avatar himself is of course level 10.

Note the Strongest Avatar Party is the same, just all at level 10.

---------- Post added at 02:15 ---------- Previous post was at 01:10 ----------

I've done a calculation that with 5 Hero Gates, each with 9 possible party spawns, and 1 more Gate with 2 possible spawns, I will *definitely* exceed the 48 IF condition limits. I'm also going to go out on a limb to guess that a Barracks or Graveyard alone could be sufficient to control the difficulty of the Spawns.

Since Barracks occurs earlier, I will just go with Barracks as the Party Controller, and assume that people don't really find a reason to build it beyond 4x4.
I understand some comments given are that its rather useless, and 1 tile is enough to attract Orcs.
Please, please FEEDBACK here if my understanding is incorrect.

Sad to say, I have little choice but to greatly reduce the types of party spawns from 9 to 5, in order of difficulty to be...
1) Default : Level 5, Party of 5
2) 17 Tiles : Level 7-8, Party of 6
3) 25 Tiles : Level 7-8, Party of 7
4) 30 Tiles : Level 10, Party of 6
5) 35 Tiles : Level 10, Party of 7
Also, when you attack the Keep, the Defensive Parties from 2 Gates will no longer default to Party 1).
Instead it will default to Party 2) then going straight to 5) at 30 Tiles.

With this, for 2 Defensive Gates I use (1+2) IFs each.
For the Main Gate and 2 Offensive Gates on your side, they will use (1+5) each.
For Avatar Gate it will use (1+2) IFs when spawning the Avatar & Bodyguard, +2 IFs for Winning the Game.
The Barracks Configuration will require 5 IFs
34 IFs used altogether.

===============

3 Timer tiers of 40, 25, 15 corresponding to Temple Tiles 26 30 35

IF (Timer <= 15 mins)
IF TEMPLE >= 35
Set Spawn Flag
Reset Timer

IF (Timer <= 25 mins)
IF TEMPLE >= 30
Set Spawn Flag
Reset Timer

IF (Timer <= 40 mins)
IF TEMPLE >= 26
Set Spawn Flag
Reset Timer

40 IFs used so far.

================

And the Spawn Flag.
Torture Chamber 26 spawns the West Gate, 30 spawns the East Gate, 35 Spawns both.

IF Spawn Flag On
IF Hero Creatures < 100
{
Spawn Main Gate

IF Torture Chamber >= 26
IF Torture Chamber < 30
Spawn West Gate

IF Torture Chamber >= 30
Spawn East Gate
IF Torture Chamber >= 35
Spawn West Gate
}
Total 6 IFs

==============

46 IFs in all.

Whew... This is just Metacode to try and organise the script.. hopefully I can finalise it tomorrow... Yay...

Zyraen
June 11th, 2011, 04:52
If anyone is interested (to check), I have included the Script into the first post as a Spoiler.
Meantime I'll be testing the level :) wish me luck...

Metal Gear Rex
June 11th, 2011, 05:06
I made a similar map once, except it involved fighting invasions. (You choose when you want them to come, and how strong you want them to be) Though I ran into a problem with KeeperFX while using it, which is why I made a thread about it.

If you want to look at it, the thread is here (http://keeperklan.com/threads/1798-Strange-Error-in-Map-Error-from-KeeperFX). The map is Flowerhat, as I usually don't like to waste time mapping to test this kind of thing, I just mod an existing map. If you ever make a Sandbox-type level with Hero Invasions instead, you could look at the script I made.

Zyraen
June 11th, 2011, 08:47
Thanks for the Great Tip :) with your link, I managed to solve what was stopping the Spawns.

Then I put Scripting debugging on hold and had myself a Royal time Sandboxing and killing off swarm after swarm after swarm after swarm of Heroes.
Man, its great to be evil :D

Duke Ragereaver
June 11th, 2011, 08:49
I like the progress you are making, keep it up! ;)

Zyraen
June 11th, 2011, 17:18
K quick update, What Works
- the 5 different party type spawn correctly at the main Hero Gate
- the Trigger to spawn the Avatar & 2 Defensive Gates for the winning condition works
- the Temple and Barracks are both upgradeable / downgradeable without further coding

What doesn't work
- The 2 Defensive Gates do not spawn on their own (separate from the Avatar)
- The 2 Offensive Gates on your turf do not spawn
- Spawned Fairies almost always get stuck
- The AI tends to build a separate copy of the "prebuilt" rooms
- The AI runs out of space to build.
- Despite the conditions being in place, it does not seem possible (yet) to win the game.

Other than that, looks great :)

Metal Gear Rex
June 11th, 2011, 17:28
How many parties are being spawned and through which commands exactly? How many If statements have you used? In case you didn't know, there's a limit to both.

`ETCH
June 12th, 2011, 03:09
This sounds verrrrry interesting :D

Zyraen
June 12th, 2011, 04:55
I've done a calculation that with 5 Hero Gates, each with 9 possible party spawns, and 1 more Gate with 2 possible spawns, I will *definitely* exceed the 48 IF condition limits. I'm also going to go out on a limb to guess that a Barracks or Graveyard alone could be sufficient to control the difficulty of the Spawns.

Since Barracks occurs earlier, I will just go with Barracks as the Party Controller, and assume that people don't really find a reason to build it beyond 4x4.
I understand some comments given are that its rather useless, and 1 tile is enough to attract Orcs.
Please, please FEEDBACK here if my understanding is incorrect.

Sad to say, I have little choice but to greatly reduce the types of party spawns from 9 to 5, in order of difficulty to be...
1) Default : Level 5, Party of 5
2) 17 Tiles : Level 7-8, Party of 6
3) 25 Tiles : Level 7-8, Party of 7
4) 30 Tiles : Level 10, Party of 6
5) 35 Tiles : Level 10, Party of 7
Also, when you attack the Keep, the Defensive Parties from 2 Gates will no longer default to Party 1).
Instead it will default to Party 2) then going straight to 5) at 30 Tiles.

With this, for 2 Defensive Gates I use (1+2) IFs each.
For the Main Gate and 2 Offensive Gates on your side, they will use (1+5) each.
For Avatar Gate it will use (1+2) IFs when spawning the Avatar & Bodyguard, +2 IFs for Winning the Game.
The Barracks Configuration will require 5 IFs
34 IFs used altogether.

===============

3 Timer tiers of 40, 25, 15 corresponding to Temple Tiles 26 30 35

IF (Timer <= 15 mins)
IF TEMPLE >= 35
Set Spawn Flag
Reset Timer

IF (Timer <= 25 mins)
IF TEMPLE >= 30
Set Spawn Flag
Reset Timer

IF (Timer <= 40 mins)
IF TEMPLE >= 26
Set Spawn Flag
Reset Timer

40 IFs used so far.

================

And the Spawn Flag.
Torture Chamber 26 spawns the West Gate, 30 spawns the East Gate, 35 Spawns both.

IF Spawn Flag On
IF Hero Creatures < 100
{
Spawn Main Gate

IF Torture Chamber >= 26
IF Torture Chamber < 30
Spawn West Gate

IF Torture Chamber >= 30
Spawn East Gate
IF Torture Chamber >= 35
Spawn West Gate
}
Total 6 IFs

==============

46 IFs in all.

Whew... This is just Metacode to try and organise the script.. hopefully I can finalise it tomorrow... Yay...

How many parties are being spawned and through which commands exactly? How many If statements have you used? In case you didn't know, there's a limit to both.
Yeah, as per my earlier post, I've done a calculation of the IFs that I required against the 48 Max as advised by the DK Script Command Reference. Due to that, I only have 5 types of Parties spawning. The current script that I've attached to the main topic contains 47 or 48 IFs, I think.
I also had to limit the Torture Chamber somewhat, to West Gate, or East Gate AND West Gate (dropping the East Gate Option) as that requires me to add minimum 2 extra IFs.

Zyraen
June 12th, 2011, 08:35
@MGR on the Flowerhat Level
- Wow, that is very cool code, very simple and elegant! :) Great Stuff!

Zyraen
June 12th, 2011, 19:41
After a few playtests, it should be working fine :) I'm calling it Mellow Rib, since the Lava form makes me think of a ribcage shape.

You can find it for download here :) Hope you guys like it, and look forward to feedback.
http://keeperklan.com/threads/2047-Mellow-Rib-sandbox-level?p=32677#post32677

Metal Gear Rex
June 12th, 2011, 22:08
Yeah, as per my earlier post, I've done a calculation of the IFs that I required against the 48 Max as advised by the DK Script Command Reference. Due to that, I only have 5 types of Parties spawning. The current script that I've attached to the main topic contains 47 or 48 IFs, I think.
I also had to limit the Torture Chamber somewhat, to West Gate, or East Gate AND West Gate (dropping the East Gate Option) as that requires me to add minimum 2 extra IFs.

I saw that, but based on your previous post, it kinda sounded like you didn't fully understand the limits of the script commands.

Zyraen
June 13th, 2011, 05:49
Oh I see, actually these were the problems...

- The 2 Defensive Gates do not spawn on their own (separate from the Avatar)
Caused by wrong flag. Namely, Set PLAYER0 but the IF statement checked for PLAYER_GOOD

- The 2 Offensive Gates on your turf do not spawn
Caused by missing NEXT_COMMAND_REUSABLE on flag-setting

- Spawned Fairies almost always get stuck
Not script related

- The AI tends to build a separate copy of the "prebuilt" rooms
I'm not sure how to fix this, I assume it would deal with the "Build Order" Script of the Player, in a separate file under Fxdata

- The AI runs out of space to build
Insufficient space for the AI 0 to build up. This results in "exposed" Lairs, Training Rooms, and is worsened by the Prebuilt Rooms that occupy a fair amount of space.

- Despite the conditions being in place, it does not seem possible (yet) to win the game.
Again, a mistaken regards the Flag. Set the PLAYER0 flag instead of the PLAYER_GOOD flag.

Mothrayas
June 13th, 2011, 10:56
- Spawned Fairies almost always get stuck
Not script related

Always spawn Fairies from Action Points, not Hero Gates. Flying creatures get stuck when spawned from an Hero Gate.

Zyraen
June 14th, 2011, 03:39
Thanks for the tip :) Fairies are great support fire, just not when they get stuck... or when you have Lightning.

Zyraen
July 13th, 2011, 15:19
BTW, any feedback on the Sandbox level? :)

lanky
August 20th, 2011, 15:05
This is impossible to win! I eliminated the two keepers and then entered the hero fortress before about 8000 heroes (no joke!) swarmed me. Samurais and LOTLs kept spawning consistently when others died even when I got rid of my torture chamber, graveyard, barracks and temple. They were all level 7/8 and I eventually ran out of money throwing around heals and lightning strikes. I think I ended up with 54 mistresses, bile demons and dragons all at 10 through scavenging and still got absolutely mauled!

Zyraen
August 21st, 2011, 12:24
Just to confirm, its the download here...
http://keeperklan.com/downloads.php?do=file&id=90

Did you build a temple larger than 25 ? or was it less than 25?
From the sound of things, you built a big big temple of 36 tiles or more...
BTW - the Temples you take over after killing the enemy Keepers ALSO COUNT.
Sell them as soon as you get them.

Thanks for playing, sorry about the problem ^^;;;

lanky
August 21st, 2011, 14:56
As soon as I got temples, I sold them so I don't know what went wrong. I don't think I had a temple before that. Other than that, it was quite enjoyable so I'd be interested in sequels. Did I download an old version perhaps? I'll try that one and get back to you

Zyraen
September 6th, 2011, 06:56
Does the version on the KeeperKlan website work ok for you?
And what would you like to see in sequels?