Sloped sprites in build engine
#1 Posted 01 April 2020 - 10:07 AM
(First of all, thanks to Nuke.YKT, I'm just the messenger here)
And no.. this isnt't some cruel April fools joke.
While the monolith GIF itself was partially faked with frame by frame, what you saw was real. Sprites can now slope!
What does this mean?
- Sloping practically recycles sector sloping code routines
- It's fully integrated to the game, all 3 render modes.
- Backwards compatible
- Slope units == sector slope units
- Collision works... about as well as you can expect from sprites, don't expect miracles
- You may notice seams in surfaces, this is partially due to lack of precision. Things will need more fudging around.
Downloads
Latest EDuke32
Source code
Sloping hotkey sciptfile
Changelog
+ Added a special case when floor slope = sprite slope when using CTRL + PGDN/PGUP, this will flatten the sprite by taking origin from the middle instead of the "tip"
How to use
Slope like you would slope floor/ceiling.
Any change in apparent top/down size due to sloping will be reflected in 2D mode.
For script file, drop it to the directory and run "include slope" in console. Instructions few posts after this one.
Compatibility?
As there is no new map format yet, this takes a similar approach to TROR where some structs WILL get recycled.
The "very" rarely utilized sprite[].xoffset and sprite[].yoffset arrays get combined together in order to provide sprite[].slope, these arrays are practically never touched by mappers unless as a last ditch effort to tweak some things visually.
Things will remain backwards compatible. Sloped sprites will simply cause an "invalid/illegal" combination from now on.
Normally for a floor aligned sprite you use cstat bit 32 but in this case a sloped sprite will have cstat 48, making the sprite both floor and wall aligned.
This normally is reserved for voxels but there is a workaround in the draw loop that hacks around this.
Long story short, No breakage: offsets still work as normal and are only recycled for sloping when using a normally "impossible" cstat combination reserved for voxels (which are not affected here either).
PLEASE NOTE!
<removed> This has been integrated in mainline!
#2 Posted 01 April 2020 - 10:36 AM
oasiz, on 01 April 2020 - 10:07 AM, said:
Does that mean it will no longer be possible to use those structs for their intended purpose? I do have a mod or two where those get manipulated in code to adjust the offsets on sprites on the fly.
This is very cool, by the way, I'm just trying to figure out whether my mods will be broken and what to do about it.
#3 Posted 01 April 2020 - 10:41 AM
Trooper Dan, on 01 April 2020 - 10:36 AM, said:
This is very cool, by the way, I'm just trying to figure out whether my mods will be broken and what to do about it.
It still works with flat/wall/non sloped floor sprites. It also will work with sloped sprites once new map format is added
This post has been edited by Nuke.YKT: 01 April 2020 - 10:42 AM
#4 Posted 01 April 2020 - 10:41 AM
#5 Posted 01 April 2020 - 10:42 AM
So you might get issues if you want to use those code bits with sloped sprites specifically OR somehow force cstat 48 to that sprite
#6 Posted 01 April 2020 - 01:48 PM
You must be burned at the stake in the name of our masters, Ken Silverman and Todd Replogle!
JK. this is pretty cool!
#7 Posted 01 April 2020 - 02:01 PM
Some general questions are:
What are the performance of sloped sprites compared to regular floor-aligned ones?
It seems the justification for a brand new map format are growing and growing. Are there any plans in the works to implement that, and if so, will wall-aligned sprites gain rotating functionality too?
#8 Posted 01 April 2020 - 04:28 PM
Micky C, on 01 April 2020 - 02:01 PM, said:
Some general questions are:
What are the performance of sloped sprites compared to regular floor-aligned ones?
It seems the justification for a brand new map format are growing and growing. Are there any plans in the works to implement that, and if so, will wall-aligned sprites gain rotating functionality too?
Performance is worse than non sloped floor because of use division operation (regular floor sprite doesn't need division operation as it uses precalculated lookup tables and affine texture mapping), i think performance should be similator to regular sloped floors/ceilings with masked texture enabled.
#9 Posted 02 April 2020 - 12:36 AM
Micky C, on 01 April 2020 - 02:01 PM, said:
Can't comment on wall aligned sprites much, I don't think there are existing provisions for that the same way as floor ones.
As for new text-map format, this is in constant discussion.
Goal is to ultimately serve beyond just stock duke3d stuff, i.e. you could actually include arbitrary tags in sectors/sprites.
Who knows, maybe we can have a better tile index system as well and finally allow tile number overlaps to co-exist as well.
There are other things on the list such as allowing .blend to be set on floor/ceiling of sectors and walls. In fury we used negative .extra just to use it on maskwalls (no wysiwyg in editor because of this)
#10 Posted 02 April 2020 - 12:48 AM
Honestly, I keep learning about yet-unknown-to-me Mapster32 features every day, and those can be some incredible life- or time- savers (e.g.. I know I'm super late on it, but that automatic text entry thing is such a blessing, been loving it lately when for the longest of times I was used to placing every single letter sprite manually). I figure many old school mappers who don't really focus on coding and various 'inner' technicalities are in my situation as well.
This post has been edited by ck3D: 02 April 2020 - 12:57 AM
#11 Posted 02 April 2020 - 01:27 AM
At the moment it's very unlikely that these limits will ever be extended further as it would require extensive rewrites to many core components.
For time savers, I wish to some time do a proper re-write on the scripts I did for fury so that they can be more modular and useful outside of fury as well.
I've added a dozen on time savers from things like "paste slope" to things like "hide all sector effectors". There is an insane amount of quick wins in the editor that never have been addressed before.
x/y offsets can be useful in very limited cases, what it does is that it basically visually offsets the sprite x/y roughly the same distance as the sprite size itself.
Use cases could be "floating" sprites that are tied to a tiny rotating sector but appear to rotate mid-air (making pivot be at bottom-right instead of center for example).
You can also get around sprites having a tiny sector by placing the sprite in a sector that is more likely to be drawn and then offsetting it to be at the desired place.
It's very much more about fixing corner cases where manually setting sector number for a sprite isn't enough.
#12 Posted 02 April 2020 - 03:08 AM
Good on you for implementing all the new time savers outside of Fury as well. Might be a long shot, but theoretically I'm inclined to think that making mapping more casual and accessible all the while preserving all the core functions would probably encourage a newer breed of creators who didn't grow up with Brett Gmoser's 1996 FAQ to give it a try. Just the original appearance of Mapster32 on the scene vs. the older editors definitely did just that, I'm willing to bet (virtual bet though - times are dire). Good games are not just timeless, but publicized on popular platforms like YouTube more than ever nowadays and I'm seeing a very blatant resurgence of interest in the Build engine (of course Fury helped a lot there), so I don't think I'm being naively optimistic.
Just for comparison's sake, I remember looking up 'Duke 3D user map' on YouTube just a few years ago and the results would be close to nothing. Now you get video playthroughs by the hundreds, not even counting mod reviews and whatnot, I think that's really cool.
This post has been edited by ck3D: 02 April 2020 - 03:10 AM
#15 Posted 03 April 2020 - 08:43 AM
But see this script: HERE !!!!!
I backported a few similar slope related hotkeys from fury for this one.
[TAB] Read slope value to clipboard (Done along with texture stuff)
[SHIFT + Y] Paste slope to floor/ceiling/sprite
[SHIFT + U] Take ceiling sloping and apply it to sprite
[SHIFT + J] Take floor sloping and apply it to sprite
[CTRL + SHIFT + U] Take ceiling sloping and apply it to sprite and "flatten" against ceiling
[CTRL + SHIFT + J] Take floor sloping and apply it to sprite and "flatten" against floor
Bonus round: [Mouse 5] Reset horiz to 90 (straighten view) -- This one needs to be default honestly.
Bonus Bonus, videos in action:
#16 Posted 06 April 2020 - 08:30 AM
https://dukeworld.du...8809-8ce0e74bb/
You can consider the support official as no major breakage was detected or reported.
#19 Posted 06 April 2020 - 12:37 PM
oasiz, on 06 April 2020 - 08:30 AM, said:
I'd need such a mechanism for easy bisect-compiling without the hassle of those annoying and meaningless Git checksums.
#20 Posted 06 April 2020 - 01:00 PM
However, for bisecting you might as well use git bisect.
#21 Posted 06 April 2020 - 01:10 PM
Hendricks266, on 06 April 2020 - 01:00 PM, said:
However, for bisecting you might as well use git bisect.
#22 Posted 06 April 2020 - 01:39 PM
From my experience, you will have to use commit hashes and I think you might want to create some wrapper for it.
With git rev-list --count HEAD you can get the current revision (number), keep in mind that this is simply a counter for commits, however it's the closest parallel to a revision number.
To get "all commits" with one per line, you can use git --no-pager log --oneline
I'm afraid that you'll have to cook up a shell script to correlate a commit ID with the hash itself (list is linear) git really dislikes using those numbers.
Pretty sure awk combined with some shell scripts you can have a list with: commit number,hash,message -- by using the above git log command.
From there on you can then checkout specific versions but I don't remember the exact commands.
I think there should also be much better diffing tools right out of the box though so you should be able to give HASH1 and HASH2 to see what was exactly changed, of course with a wrapper you could easily populate these hashes too.
#23 Posted 06 April 2020 - 03:26 PM
oasiz, on 06 April 2020 - 01:39 PM, said:
Since no one else seems to keep track of reported issues, this is also helpful when bumping again after some time.
#24 Posted 07 April 2020 - 12:52 AM
Not sure if you've ever experienced "gamedev" game testing but a typical bug report can be flat out rejected if there are no clear reproduction steps, logs, screenshot/video, etc..
Now of course this is not a professional gamedev project and requirements aren't that strict, there have been quite a few reports I've done that I've had to remind again in 6 months and explain the nature again. There is a lot of work constantly being done all around and some things just get a different priority (or pushed aside in order not to constantly context switch).
Imagine the constant context switching if the developer had to spend hours reproducing bug after bug
"Game testing" is a very thankless and tedious job/task, but yes, when this tedious task is lifted then it's much more likely that the dev can focus their energy on fixing it.
#25 Posted 07 April 2020 - 08:42 AM
LeoD, on 06 April 2020 - 03:26 PM, said:
Since no one else seems to keep track of reported issues, this is also helpful when bumping again after some time.
Going forward, please register an account on voidpoint.io and file bug reports when you encounter things that are broken. This is something we've been working on putting together for a while now, and it's our answer to the longstanding issues our project has faced regarding issue tracking and discussion/communication of changes.
#26 Posted 07 April 2020 - 10:59 AM
TerminX, on 07 April 2020 - 08:42 AM, said:
#27 Posted 07 April 2020 - 11:31 AM
#28 Posted 14 April 2020 - 05:39 AM
A question: how do you quickly reset the slope to zero in Mapster? The slash key doesn't affect sprite slopes for a reason. =(
#29 Posted 14 April 2020 - 06:33 PM
Jan Satcitananda, on 14 April 2020 - 05:39 AM, said:
It does now.