Zandronum Chat on our Discord Server Get the latest version: 3.2
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000848Zandronum[All Projects] Suggestionpublic2012-05-14 21:182015-05-26 00:47
ReporterDusk 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusclosedResolutiondenied 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000848: Customizable Random Powerups
DescriptionBranch here:
'https://bitbucket.org/CrimsonDusk/notebola/changesets/tip/branch(%22randompowerup%22) [^]'

Basically I went and revamped the random powerup code, allowing customization in the process. You can now define your own random spawners with any list of effects you like.

The random powerup now reads the dropitem list as a list of possible candidates. The numeric argument (generally means probability) means what bits the effect has. You may be aware that a random powerup's args[0] is actually a filter, these "probabilities" are bit numbers that are checked against the filter.

A_RandomPowerupFrame now advances a "cursor" to the next entry to the dropitem list and attempts to set it as the selected effect of the powerup. If the selection fails, it skips the frame it was attached to. If selection of ALL entries on the list are detected to fail, the powerup turns into an <!> exclamation mark of doom to prevent infinite loops. This failsafing wasn't present - if you for instance spawned a random powerup with args[0] of 16 (timefreezer only) and went to multiplayer mode, Skulltag would crash like this.

There's a couple of problems though. The aforementioned time freezer only ever is considered if the game is in offline mode. It's forbidden in even emulated multiplayer mode. What do? I was thinking about limiting the time freezer to cooperative with a way to turn this exception off somehow.

Also, I'm not sure did I adjust ARandomPowerup::Serialize properly. I'm completely unfamiliar with the Serialize method and just went with the assumption that it excepts the arc variable to be streamed pointers to the member variables.

Another one is that when you pick the powerup, the sound that's played is always the default item pickup sound... even though the random powerup only ever gives spheres. Should it cause the sound of the pickup it ultimately gives to the player?

And one last problem: what if the pickup is supposed to fail? See attached example wad with RandomRune, you can pick up two of the same rune types.

Aside from these problems, I'm pretty glad how this turned out so far. :)
Additional InformationSee attached example wad for an.. example of the new random powerup usage.
Attached Fileszip file icon randompowerup.wad.zip [^] (1,515 bytes) 2012-05-14 21:18

- Relationships

-  Notes
User avatar (0012398)
Dusk (developer)
2015-05-26 00:47

In retrospect this was a bad idea. DECORATE and ACS are flexible enough to produce such a random powerup if needed...

Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2012-05-14 21:18 Dusk New Issue
2012-05-14 21:18 Dusk Status new => assigned
2012-05-14 21:18 Dusk Assigned To => Dusk
2012-05-14 21:18 Dusk File Added: randompowerup.wad.zip
2012-05-14 21:19 Dusk Status assigned => needs review
2012-05-14 21:19 Dusk Description Updated View Revisions
2015-05-26 00:47 Dusk Note Added: 0012398
2015-05-26 00:47 Dusk Status needs review => closed
2015-05-26 00:47 Dusk Assigned To Dusk =>
2015-05-26 00:47 Dusk Resolution open => denied






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2025 MantisBT Team
Powered by Mantis Bugtracker