Duke4.net Forums: Map Order Randomizer - Duke4.net Forums

Jump to content

Hide message Show message
Welcome to the Duke4.net Forums!

Register an account now to get access to all board features. After you've registered and logged in, you'll be able to create topics, post replies, send and receive private messages, disable the viewing of ads and more!

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Map Order Randomizer  "Changes how you approach Duke Nukem 3D"

User is online   Daedolon 

  • Ancient Blood God
  • 895

#1

Hey guys.

With the Duke Hard CBP talk about randomization (thanks to Lunick), I thought I'd try to write something small quickly just to see how it could be done. Well, it took a bit longer than I planned but that's how things always go. Anyway...

This is a "gameplay" modification with a custom CON file (literally eduke.con file that calls game.con, then my custom con file) that leaves the original GAME.CON, DEFS.CON and USER.CON untouched, so you can use this with one of your own mods as well as long as you make sure the gamevar definitions are correct. Basically what the mod does is randomize the level order of any of the four episodes in Duke Nukem 3D 1.5, without telling you (unless you're a cheater). For example the most hilarious order I got when testing this was on The Birth; The game instantly sent me to The Queen and Derelict right after that... with It's Impossible being the last map.

It's literally randomized, which, I noticed, made it surprisingly fun to play through episodes since you have no clue what's coming up next. Depending on the randomization, some orders can bring some new challenges to some of the levels as well if you're used to having weapons or inventory items from previous levels.

Few things to note:
  • The game creates a random level order every time you choose New Game from the main menu.
  • Killing bosses now instantly ends the level, I had to do this because how their episode ending code worked.
  • All nukebuttons are now regular nukebuttons, but you still can use the secret level ones (and visit the secret levels as well).
  • Whatever the last level of the episode ends up being, it ends in the correct cutscene and sends you back to the main menu after completion.
  • Cheating (DNSCOTTY) breaks the randomization until the next level as this doesn't change the "physical" map order. Don't be an asshole, don't cheat.
  • It's pretty rough overall since I wanted to get it to this point. It's as is, but I'll likely revise it a bit further.
  • EDuke32 only. Written and tested on r4309, can't promise it works in earlier revisions.
  • No original gameplay of Duke3D 1.5 has been changed except for what's written above.


There are really no screenshots to show, but here's one with the progress meter I added (which you can disable by typing "setvar showprogress 0" in the console).

Attached Image: duke0000.png
Here you can see I went through Pigsty, Duke Burger, Going Postal and then ended up in The Queen, with seven more levels to spare.


Have fun and let me know if you liked it (or alternatively, found any more issues etc.)!


Shout-outs to Mblackwell.


Attached File  MapRandomizer-0.2.zip (3.1K)
Number of downloads: 180

Lunick: I can't believe you can pre-order Duke Nukem 3D in 2016

This post has been edited by Daedolon: 22 February 2014 - 11:13 PM

4

User is offline   Stabs 

  • 210

#2

often wondered if you could make bits, like corners, crossroads, halls, etc etc like tilesets and run a script to make a random maze like map
1

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!
  • 4,790

#3

View PostDaedolon, on 22 February 2014 - 10:47 PM, said:

[*]All nukebuttons are now regular nukebuttons, but you still can use the secret level ones (and visit the secret levels as well).

It would be cooler if you still had to use the Nukebutton to access all levels. Even better if the color of the Nukebutton changed if a level was made secret or not.
0

User is online   Daedolon 

  • Ancient Blood God
  • 895

#4

I think combining this with some code that randomly flips or mirrors the levels as well could be really interesting.

View PostFox, on 22 February 2014 - 11:01 PM, said:

It would be cooler if you still had to use the Nukebutton to access all levels. Even better if the color of the Nukebutton changed if a level was made secret or not.


I literally wasn't considering anything other than poking at making a map randomizer, but that sounds like a cool idea, especially if the secret level was chosen randomly.

Lunick: I can't believe you can pre-order Duke Nukem 3D in 2016

This post has been edited by Daedolon: 22 February 2014 - 11:02 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!
  • 4,790

#5

You could also add a monsters randomizer or something.
0

User is online   Daedolon 

  • Ancient Blood God
  • 895

#6

Changing anything within the levels isn't in my plans, though.

EDIT: Noticed that when I changed around some of the boss handling, now even mini-battlelords end the level, heh. I'll fix that tomorrow I guess.

Lunick: I can't believe you can pre-order Duke Nukem 3D in 2016

This post has been edited by Daedolon: 23 February 2014 - 12:24 AM

0

User is offline   Helixhorned 

  • EDuke32 Senior Developer
  • 698

#7

Interesting mini-mod. I haven't tried it out yet, but I've got a couple of comments to make.

Please change these,
setuserdef THISACTOR.level_number temp

into
setuserdef .level_number temp

(A patch is attached.)

As discussed here in partucular, and on that whole page in general, userdef is a global structure, so it doesn't need an index to be accessed at. The real reason I'm asking is because LunaCON won't accept it syntactically. I already made it accept these (from lunatic/test/getuserdef.con):
    //  - all three are equivalent:
    getuserdef[THISACTOR].statusbarscale temp
    getuserdef .statusbarscale temp
    getuserdef[].statusbarscale temp

but it seems that C-CON accepts just about any garbage between the '*etuserdef' token and the '.xxx' member name. Sigh, C-CON.

The way you wrote it should make it possible to be used independently as a mutator in theory. Nice!

View PostDaedolon, on 22 February 2014 - 10:47 PM, said:

This is a "gameplay" modification with a custom CON file (literally eduke.con file that calls game.con, then my custom con file)

It would be more correct to say that game.con is textually included, then your randomizer.con. Because that's what include effectively is -- you can pick apart a single CON file at directive/block boundaries, and include the parts in the corresponding order. The result should be the same.

Attached File(s)



(o~ Lunatic home: documentation, stand-alone LuaJIT, LunaCON and utilities ~o)
1

User is online   MetHy 

  • 1,478

#8

This is really cool! I'm liking it.

However, how would the numbers of level in the hud look like with 20+ maps? and how would it look like in lower resolutions?

Also I got a glitch. I strated by playing Critical Mass (map 8), but I died in the explosions upstairs after the start of the map. So, it got me to restart the map but the hud now showed maps 8 - 10,with 10 in red as if i was playing map 10 while I still was in 8. After that, everything went normal and the glitch didn't appear again when I killed myself on purpose several times to see if it would happen again.

Now what I wonder if, with this glitch, I wouldn't play map 10 at all since it thinks I already have. I have saved on the 4th map, I could try that.

Posted Image
0

User is offline   Trooper Dan 

  • Duke Plus Developer
  • 2,900

#9

View PostDaedolon, on 22 February 2014 - 11:01 PM, said:

I think combining this with some code that randomly flips or mirrors the levels as well could be really interesting.


This mod is a good idea, although it makes more sense for collections of user maps so they can be played as episodes. Map order randomization is a major feature of my Attrition mod, although in that case it applies to a random subset of a large set of maps -- you must be doing it quite differently since in your mod every map is guaranteed to be played. Attrition also has random map mirroring (thanks to code from Plagman) and lots of other stuff. Your mod would appeal more to players who want the classsic Duke 3D experience but just want to mix things up a bit.

Unfortunately, all of the maps that can be played with the mod must be defined into episodes in the CON files before any randomization can occur. If it were possible to have the game read from a maps folder instead, then players could just drop the maps they want into the folder and then the code could select them randomly.
0

User is offline   DavoX 

  • Honored Donor
  • 667

#10

Remember that the last map can't be random as it's located in the rooftop!
0

User is online   Daedolon 

  • Ancient Blood God
  • 895

#11

View PostHelixhorned, on 23 February 2014 - 03:08 AM, said:

Interesting mini-mod. I haven't tried it out yet, but I've got a couple of comments to make.

Thanks for the heads up, I'm a bit rusty these days. I'll add the changes when I fix few other issues.

View PostMetHy, on 23 February 2014 - 05:29 AM, said:

This is really cool! I'm liking it.

Yeah, I wasn't sure if a randomized order would work for the CBP, but seeing it work with the regular maps (and be fun) makes it plausible for the CBP as well, which is something that I wasn't expecting.

View PostMetHy, on 23 February 2014 - 05:29 AM, said:

However, how would the numbers of level in the hud look like with 20+ maps? and how would it look like in lower resolutions?

However I wanted? Like I said I just made this with 1.5 in mind, but it's easy to fix it for anything. I don't think the CBP, for example, should show these numbers.

View PostMetHy, on 23 February 2014 - 05:29 AM, said:

Also I got a glitch. I strated by playing Critical Mass (map 8), but I died in the explosions upstairs after the start of the map. So, it got me to restart the map but the hud now showed maps 8 - 10,with 10 in red as if i was playing map 10 while I still was in 8. After that, everything went normal and the glitch didn't appear again when I killed myself on purpose several times to see if it would happen again.

That's odd, though I really didn't try getting killed all that much since I just thought I'd throw this out here as an idea. I guess if anyone can figure out what that is, I could fix that.

View PostTrooper Dan, on 23 February 2014 - 08:30 AM, said:

you must be doing it quite differently since in your mod every map is guaranteed to be played.

It literally just counts the number of maps in the episode you're playing, and randomizes the order of those ones.

I pretty much just made this as a quick test to even see how viable something like this would be, so I made it with 1.5 in mind. I guess the idea could be expanded into something with more options and features (map mirroring etc.) for people who really want a randomized output.

View PostDavoX, on 23 February 2014 - 09:57 AM, said:

Remember that the last map can't be random as it's located in the rooftop!

That's an easy fix, but I wanted to play through all of the playable maps in 1.5 myself so I set it like this here.


I need to figure out what's causing that Critical Mass issue, then add few fixes and update this.

Lunick: I can't believe you can pre-order Duke Nukem 3D in 2016
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks are property of their respective owners. Instead of reading this text, you could be playing Ion Maiden! ;) © 2018 Voidpoint, LLC

Enter your sign in name and password


Sign in options