SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Editing > Editing Help

Reply
 
Thread Tools Search this Thread
Old 07-27-2017   #1
Telwen
 
Telwen's Avatar
Default Questions on Optimization, OpenGL Issues

Was wanting to ask a few questions as I'm wrapping up making a level and wanted to do another sweep of cleanup soon, but there's some questions either unanswered or solutions I think could be better.

OpenGL

This is probably the most apparent. I've had several times (and even now currently) where the level I make ends up having visual errors in OpenGL that Software doesn't have. The prime example being tears in the map. The most basic solutions I can come up with has just been to modify the terrain repeatedly until it goes away, but I'm sure there's some sort of reason why this comes up. Looking at the OpenGL article in the wiki doesn't seem to mention this but I do see basic tears in other accepted levels, just not something like an entire wall acting like a HOM even though it has a texture applied to it. Example is given below:

In Software:



In OpenGL:



Maybe something to do with wall angles or something to that effect? I'm not sure. Some guidance on how to avoid this would be appreciated.

Switch Coding

So in the map, I wanted to make a section where you needed to hit multiple switches to open a door. A basic switch to open one door is pretty simple, but there's no real basic way of making it so if you hit n switches it opens m doors and no option like this is really seen in any of the linedef options (the closest being trigger after X calls, which I use). So I'm not sure of an optimal way of doing this. I have a solution, but to me it seems so obtuse that there has to be a better way. Method is:

Create a sector which triggers after a tag is called two times, it will open a door. Make another sector with the tag attached to it, two sides of its linedef given the invisible, intangible linedef and place these sectors under the button so they cannot be touched through ways not touching the button. Give this sector the trigger when in sector property and give it the same tag as the tag needed to open the door. When the button is pressed, raise the ceiling of the invisible sector (so this happens to both buttons) high enough so it hits the player, and do this in less time than a second, and then in that exact amount of time move the sector back into the ground. That way the player, when pressing the button, is essentially hit with the sector once and can no longer hit it again. Once both buttons are pressed the flag is called twice and the door opens.

Watching this happen when the floor is set to translucent is amusing, but it makes me wonder if there's a more sensible way of doing this other than having invisible sectors hitting the player? It also doesn't help that it is entirely possible to stand on the switch in such a way that the button is pressed but you don't get hit by the sector at all. And if you make the sector that hits the player larger than the button sector its possible to make it call more than once making the door open after pushing only one button.

Busting Walls to Trigger Events

This one is a similar problem but less confusing. Basically there are moments in the level where you have to bust walls to progress in the level. Right now my idea is to place invisible, intangible sectors in the same place as the bustable wall, that way once someone busts the wall they have to hit the invisible sector too, right? Well, if you sort of tiptoe up to the wall with Knuckles, its entirely possible to bust a wall without hitting the invisible sector too. Obviously, if its any bigger then you can trigger the switch without busting the wall and it looks silly. Is there a way to basically make the game go "if this wall is busted, do this" more directly than that?

Busting One Wall Busts Two?

Another issue is tied to the above. There's one part where you bust a wall to set off a switch; however, its placed above "bars", meaning that the area in question is actually a mesh of two different sectors instead of just one, and the areas are close knitted together enough that you can't just cover up one without the other with bustable walls. The issue is that its easy to bust just one of the walls and not the others, and this looks silly. Is there a way to break a bustable wall remotely?

I think that's all of the problems I ran into. Thanks for any help that you can provide.
Telwen is offline   Reply With Quote
Old 07-28-2017   #2
RedEnchilada
happy, pretty, lovely!
Developer
 
RedEnchilada's Avatar
Default

Switch Coding
There are two ways you can do this in a fool-proof manner, both of which involve what's called a gargoyle box. You can either have each button trigger http://wiki.srb2.org/wiki/Linedef_type_405 to move a floor in an out-of-map sector up/down a set number of fracunits, or set up two FOFs in an out-of-map sector and have each button move one of them down below the floor with http://wiki.srb2.org/wiki/Linedef_type_404 . Either way, your goal would be to make it so that, when both buttons are pressed, the moving floor(s) drop a gargoyle placed inside the sector into a http://wiki.srb2.org/wiki/Trigger_Li...hable_Objects) linedef executor trigger that performs your desired action. That's a pretty vague summary of the mechanism since it's late and I need to get some sleep; feel free to ask for clarification on the specifics.

Basically, gargoyle boxes are awful hacks that are used extensively for complicated in-level scripting logic.

Busting Walls to Trigger Events
http://wiki.srb2.org/wiki/Bustable_Block As detailed here, using the Repeat Midtexture flag (it may be called Effect 5 if you're using an old editor configuration) will trigger a linedef executor when the clock breaks, with a tag equal to the linedef's length. (Really? The length? Eww.) Use a straight horizontal/vertical line for this, as the game computes length inaccurately for diagonal lines.

Busting One Wall Busts Two?
Refer to the above, and have the linedef executor call http://wiki.srb2.org/wiki/Shatter_FOF . You can safely use the same linedef executor to shatter both walls; IIRC the game doesn't do anything if the FOF you specify has already been shattered?
__________________
Quote:
<@toaster> '"sonic robot explosion 2", the hot new sensation for teens looking for a good time, tempts many children away from god each year'
av src
RedEnchilada is offline   Reply With Quote
Old 07-28-2017   #3
Monster Iestyn
Friendly Neighbour-Hood
Moderator
 
Monster Iestyn's Avatar
Default

Switch Coding

Here's an idea: What if you used linedef type 450 (Execute Linedef Executor (from Tag))?

Then, say, set up each button with it's own linedef executor with a "Once" trigger, that lowers the button floor and triggers the Trigger After X Calls linedef for the main linedef executor for opening the doors. That way the buttons cannot trigger the Trigger After X Calls linedef more than once each.

In other words the chain of events could be like this:

Press button -> "Once" trigger -> Lower button + linedef type 450 -> Trigger After X Calls
__________________
My page stuffed full of MIDI goodness!
The Hitchhiker's Guide to the Robo-Hoodiverse
Timeline of Sonic Robo Blast History!

That's an uppercase i, not a lowercase L, for the record.
Monster Iestyn is offline   Reply With Quote
Old 07-28-2017   #4
Telwen
 
Telwen's Avatar
Default

Quote:
Originally Posted by RedEnchilada View Post
Switch Coding
There are two ways you can do this in a fool-proof manner, both of which involve what's called a gargoyle box. You can either have each button trigger http://wiki.srb2.org/wiki/Linedef_type_405 to move a floor in an out-of-map sector up/down a set number of fracunits, or set up two FOFs in an out-of-map sector and have each button move one of them down below the floor with http://wiki.srb2.org/wiki/Linedef_type_404 . Either way, your goal would be to make it so that, when both buttons are pressed, the moving floor(s) drop a gargoyle placed inside the sector into a http://wiki.srb2.org/wiki/Trigger_Li...hable_Objects) linedef executor trigger that performs your desired action. That's a pretty vague summary of the mechanism since it's late and I need to get some sleep; feel free to ask for clarification on the specifics.

Basically, gargoyle boxes are awful hacks that are used extensively for complicated in-level scripting logic.

Busting Walls to Trigger Events
http://wiki.srb2.org/wiki/Bustable_Block As detailed here, using the Repeat Midtexture flag (it may be called Effect 5 if you're using an old editor configuration) will trigger a linedef executor when the clock breaks, with a tag equal to the linedef's length. (Really? The length? Eww.) Use a straight horizontal/vertical line for this, as the game computes length inaccurately for diagonal lines.

Busting One Wall Busts Two?
Refer to the above, and have the linedef executor call http://wiki.srb2.org/wiki/Shatter_FOF . You can safely use the same linedef executor to shatter both walls; IIRC the game doesn't do anything if the FOF you specify has already been shattered?
All three of these worked, thanks. I figured the last two would be simple, just didn't catch that flag.

Quote:
Originally Posted by Monster Iestyn View Post
Switch Coding

Here's an idea: What if you used linedef type 450 (Execute Linedef Executor (from Tag))?

Then, say, set up each button with it's own linedef executor with a "Once" trigger, that lowers the button floor and triggers the Trigger After X Calls linedef for the main linedef executor for opening the doors. That way the buttons cannot trigger the Trigger After X Calls linedef more than once each.

In other words the chain of events could be like this:

Press button -> "Once" trigger -> Lower button + linedef type 450 -> Trigger After X Calls
That would certainly work, much better than the "hitting player in face with floor" technique. More compact, too. I think I'll stick with gargoyles, but this isn't a bad idea for some future project (find x sectors, but if you find less you still get rewarded, something like that).
Telwen is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:50 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.