Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: Interiors of buildings (for an rpg)
Interiors of buildings (for an rpg)
Dec 21 2010, 2:05 am
By: Jesusfreak  

Dec 21 2010, 2:05 am Jesusfreak Post #1



I've ran into a slight problem in the creation of my rpg; I have a lot of things a player is supposed to be able to walk inside to. A player needs to be able to get in and out by bringing his unit(s) (which could be any amount of various units in various places on the map) to a certain location, so that they get moved (with the Move Unit trigger) to a separate area of the map that represents the inside of the building. There's three general ways I've figured out to do this, but all have flaws:

1.) Create four (or more for multiple entrances) locations for each building; the player walks into location 1, gets moved to location 3, and after doing whatever inside the building, walks to location 2 and gets moved to location 4.

Advantages: Is simple.
Doesn't require that the game keep track of whether or not the player is in a building.
Disadvantages: TOO MANY LOCATIONS!
May cause problems in really small buildings with little room.
Could cause problems if a lot of units are trying to cram their way in or out (a player could enter a building only to find himself unable to get out because he's surrounded by enemies at "location 3" (from the example).

2.) Create two locations for each building, and have some sort of marker at each entrance (such as a beacon). When the game detects one of these markers in a location centered at the player, change a death counter or a switch. When the game no longer detects the marker, change it back. When the game detects the marker again, it'll be reasonable to assume that the player is ready to leave the building, since he left the entrance location and then went back.

Advantages: Uh... it doesn't use as many locations as #1... that's about all I can think of...
Disadvantages: Requires a marker unit (requires a unit type be dedicated to the purpose of marking entrances and will likely have an impact on the aesthetics of the building entrance). I could circumvent this by using a death count instead of a marker unit, but that'd be significantly more trigger-work (I think).
Requires that the game know what unit is entering the building, and prevents more than one unit from entering or leaving the building at a time. (This I cannot figure out how to fix)
Requires the a player move away from the marker, which may be inconvenient if the player gets physically trapped (ie, surrounded by enemies).
Complex and tedious to implement.

3.) Have some sort of button to press (such as a reaver building scarabs) that the player could activate when they wanted to enter a building.

Advantages: Simple and easy to implement.
Allows the user to control when he enters a building, so that accidental entries are impossible.
Disadvantages: The player either would only be able to have one unit that could enter buildings, or a set of buttons for each building (which would require more locations, triggers, and space defeating the first advantage and giving it the same key flaw as system #1).
Stupid people probably wouldn't be able to figure it out.
It would be difficult to implement any secret buildings, since the player would probably have to be aware of them to take the initiative to press the button.

I think that's all the systems I've come up with so far... any ideas on better ones?

The map is an rpg, but has the possibility for players to acquire armies (most likely, anyway). The "hero" unit changes throughout the game (for instance, a player could start as a peasant (scv), then join the army and become a swordsman (zealot), then commit suicide and become a vampire (dark templar), then later try and become a Dark Lord (dark archon)), which means that if the game would have to know what unit is entering the building, I would need triggers for each possibility (even if non-heroes won't be entering buildings). And there's likely going to be a lot of buildings to put in, although I'm not certain yet (I haven't created all the buildings and decided which ones will be enterable yet; it depends on how much room I have left over when I finish drawing the world and designing the other buildings).



None.

Dec 21 2010, 2:56 am Ahli Post #2

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

A time based system, but that isn't really better than what you have thought of... :S I just wanted to throw in more alternatives (at least, something I've used before for entering buildings).




Dec 21 2010, 3:09 am DavidJCobb Post #3



To enter or leave the building, enter or leave a Bunker/transport. No secret buildings (unless you cover the Bunker/transport with sprites), but it prevents accidental entries/exits.

EDIT: Depending on your aesthetics, you'd want to use Dropships (metal buildings) or Shuttles (ruin or alien buildings).



None.

Dec 21 2010, 3:45 am Jesusfreak Post #4



Ah yes, the time one, I knew I was forgetting something...

4.) Have two locations, but have some sort of timer (probably a death counter) that will be put at some value equivalent to a few seconds whenever a unit enters a building. Prevent the trigger that causes the unit to exit the building from occurring until the timer goes out. This will give the player time to move away from the location.

Advantages: Relatively simple to implement.
Players will probably understand it.
Disadvantages: Unless we either use waits instead of death counters or have a death counter for every building, having different units (for the same player) attempting to enter/exit different buildings at the same time would be problematic.
Being moved back before you were ready is annoying.

The transport idea, that's brilliant... but I still see a problem (although possibly not as big as the others):

5.) Have a unit enter a transport near a building. When the game detects the unit in the transport (through locations that only detect air)... ok, this is where I misunderstand it: Is it
a.) The unit gets removed and recreated at the new location,
or b.) The transport is moved to the new location, and then unloads, then is moved back?

Advantages: Relatively simple to implement.
Player can easily control entry.
I (the maker) could easily control entry if I decided not to use the building after all or if I decide to make the building available for part of the game; instead of having to go back and edit the conditions for entry, I could simply remove the transport at will.
Disadvantages: Would either require multiple transports crowding the area around a building or one transport that the players would have to take turns on (which may get annoying).
Only 8 units max could enter a building at the same time.
If there's transports in another part of the game, and they happen to cross over an enterable building...
If I use any air heroes (probably won't, with the exception of the ghost (mutalisk)), they wouldn't be able to enter the transport.



None.

Dec 21 2010, 3:59 am DavidJCobb Post #5



Quote from Jesusfreak
Ah yes, the time one, I knew I was forgetting something...

4.) Have two locations, but have some sort of timer (probably a death counter) that will be put at some value equivalent to a few seconds whenever a unit enters a building. Prevent the trigger that causes the unit to exit the building from occurring until the timer goes out. This will give the player time to move away from the location.

Advantages: Relatively simple to implement.
Players will probably understand it.
Disadvantages: Unless we either use waits instead of death counters or have a death counter for every building, having different units (for the same player) attempting to enter/exit different buildings at the same time would be problematic.
Being moved back before you were ready is annoying.

The transport idea, that's brilliant... but I still see a problem (although possibly not as big as the others):

5.) Have a unit enter a transport near a building. When the game detects the unit in the transport (through locations that only detect air)... ok, this is where I misunderstand it: Is it
a.) The unit gets removed and recreated at the new location,
or b.) The transport is moved to the new location, and then unloads, then is moved back?

Advantages: Relatively simple to implement.
Player can easily control entry.
I (the maker) could easily control entry if I decided not to use the building after all or if I decide to make the building available for part of the game; instead of having to go back and edit the conditions for entry, I could simply remove the transport at will.
Disadvantages: Would either require multiple transports crowding the area around a building or one transport that the players would have to take turns on (which may get annoying).
Only 8 units max could enter a building at the same time.
If there's transports in another part of the game, and they happen to cross over an enterable building...
If I use any air heroes (probably won't, with the exception of the ghost (mutalisk)), they wouldn't be able to enter the transport.
Log who owned the transport when a hero was detected in it (player brings X ground units to air-only location). Give transport to CPU. Unload on the spot. Instantly move the unit(s) inside (hyper triggers) and give it/them back to the player.

Taking turns could work. Approach the transport to gain control. If you approach it and idle near it for a short time, it'll be automatically taken back from you; you'll have to exit the "capture radius" and re-enter to attempt to use it again.



None.

Dec 21 2010, 4:19 am ClansAreForGays Post #6



time sounds cool




Dec 21 2010, 6:16 am Jesusfreak Post #7



Quote from DavidJCobb
Quote from Jesusfreak
Ah yes, the time one, I knew I was forgetting something...

4.) Have two locations, but have some sort of timer (probably a death counter) that will be put at some value equivalent to a few seconds whenever a unit enters a building. Prevent the trigger that causes the unit to exit the building from occurring until the timer goes out. This will give the player time to move away from the location.

Advantages: Relatively simple to implement.
Players will probably understand it.
Disadvantages: Unless we either use waits instead of death counters or have a death counter for every building, having different units (for the same player) attempting to enter/exit different buildings at the same time would be problematic.
Being moved back before you were ready is annoying.

The transport idea, that's brilliant... but I still see a problem (although possibly not as big as the others):

5.) Have a unit enter a transport near a building. When the game detects the unit in the transport (through locations that only detect air)... ok, this is where I misunderstand it: Is it
a.) The unit gets removed and recreated at the new location,
or b.) The transport is moved to the new location, and then unloads, then is moved back?

Advantages: Relatively simple to implement.
Player can easily control entry.
I (the maker) could easily control entry if I decided not to use the building after all or if I decide to make the building available for part of the game; instead of having to go back and edit the conditions for entry, I could simply remove the transport at will.
Disadvantages: Would either require multiple transports crowding the area around a building or one transport that the players would have to take turns on (which may get annoying).
Only 8 units max could enter a building at the same time.
If there's transports in another part of the game, and they happen to cross over an enterable building...
If I use any air heroes (probably won't, with the exception of the ghost (mutalisk)), they wouldn't be able to enter the transport.
Log who owned the transport when a hero was detected in it (player brings X ground units to air-only location). Give transport to CPU. Unload on the spot. Instantly move the unit(s) inside (hyper triggers) and give it/them back to the player.

Taking turns could work. Approach the transport to gain control. If you approach it and idle near it for a short time, it'll be automatically taken back from you; you'll have to exit the "capture radius" and re-enter to attempt to use it again.

Hmm, that's better, but still brings the issue of many units trying to move in at once (especially if multiple players), and could cause problems for CPU units trying to move through the entrance (ie, zombies are chasing the hero out of a tomb). There's still the thing about air units not being able to get into transports too... =/
How quickly would this process take? If the shuttle only took half a second or so to be moved, unloaded, and moved back after a unit got in, it could work...

(Note: If it matters for balancing this, the players aren't necessarily allied to each other.)


Maybe I should just go with the multiple locations system... so far this hasn't been like my attempt at a civilization map where every square decimeter of territory needed a location... not sure how many locations I'll need. At any rate, it's the only system I've heard so far that won't cause inconvenience (or worse) with multiple units being controlled.



None.

Dec 29 2010, 5:20 am Vrael Post #8



Instead of using a location with for each building, center 1 location on the hero. Then, if you use 2 or more of the same building, have a death counter to keep track of which area the hero is in.

Building Owner brings at least 1 Building to Hero Location
Current Player has suffered exactly 1 deaths of Area Counter
Actions:
Move Hero to Building 1 location.
Set Area Counter to 237 (237 means Building 1 in this case)
preserve trigger

Then have a designated exit beacon for each building

Current Player has suffered 237 deaths of Area Counter
Beacon owner brings at least 1 Beacon to Hero Location
Actions:
Move 1 Hero to Outside Building 1



None.

Jan 6 2011, 5:07 am Jesusfreak Post #9



Quote from Vrael
Instead of using a location with for each building, center 1 location on the hero. Then, if you use 2 or more of the same building, have a death counter to keep track of which area the hero is in.

Building Owner brings at least 1 Building to Hero Location
Current Player has suffered exactly 1 deaths of Area Counter
Actions:
Move Hero to Building 1 location.
Set Area Counter to 237 (237 means Building 1 in this case)
preserve trigger

Then have a designated exit beacon for each building

Current Player has suffered 237 deaths of Area Counter
Beacon owner brings at least 1 Beacon to Hero Location
Actions:
Move 1 Hero to Outside Building 1

I believe that was one of the systems I mentioned (I could be wrong, it's been a while, I thought this thread had died :unsure: ). The problem with it is that it only works so long as the player has one unit, the "hero." When the player starts building towns, recruiting an army, getting new members in his party, and stuff like that, having a system that only works with one unit becomes a problem.



None.

Jan 6 2011, 1:43 pm Oh_Man Post #10

Find Me On Discord (Brood War UMS Community & Staredit Network)

A method I have uses only two locations per building, instead of your four. As well as an additional 3 locations per player.
Location Inside (the place the player teleports to) 1 per building
Location Exit (the place the player goes to leave the building [indicated by beacon or terrain feature]) 1 per building
Location Teleport (the location the player teleports to when exiting the building) 1 per player
Location Follow Small (this location is always following the hero unit around, I suspect you already have this) 1 per player
Location Follow Large (this location is always following the hero unit around, I suspect you already have this) 1 per player

What I have done is have burrowed drones next to all the enterable buildings. When the player goes to enter a building, triggers detect which building he is next to and teleports him to the corresponding room for that building. Before he is teleported, Location Teleport is centered onto the burrowed drone. When the player goes to leave the building he is teleported back to the drone.

So, in trigger form, roughly:

CON
Bring at least 1 GENERAL STORE to Location Follow Small
ACT
Move Location Teleport to Drone at Location Follow Large
Move Unit to Location Inside

CON
Bring at least 1 Unit to Location Exit
ACT
Move Unit to Location Teleport

A more effective method
>If you want to further save Locations, you can swap out "Location Exit" with another Location Teleport 2, and have burrowed Zerglings at each exit point. This way you would only need 1 location per building, and 2 locations per player (as well as the follow location which most RPGs have already). Take note, you will have to expand "Location Inside" so as to include the burrowed Zergling, yet not have the burrowed Zergling directly in the center (otherwise the player would just immediately exit again).

This method in trigger form:

CON
Bring at least 1 GENERAL STORE to Location Follow Small
ACT
Move Location Teleport to Drone at Location Follow Large
Move Location Teleport 2 to Zergling at Location Inside
Move Unit to Location Inside

CON
Bring at least 1 Unit to Location Teleport 2
ACT
Move Unit to Location Teleport

Additional Notes
As you see, it is exchanging location use with unit use. Which, imo, is a good exchange! Couple of things that make this advantageous, apart from the obvious location saving.
>The units are never seen by the player because they are burrowed, which means you can use them for other things.
>You can easily lock and unlock buildings this way, by changing the colour of the burrowed units. You can lock players inside buildings as well, if you use my second method.

>Preplace the units as P9, 10, 11, or whatever Player you prefer, as long as those units (drone, zergling) aren't being used elsewhere. This prevents the system from locking on to something it shouldn't.
>Careful where you place the burrowed drones, if they are too close to the building, you will be unable to enter the building because you will keep getting pushed back in. Remember, it has to be far enough away so as to not touch Location Follow Small, yet still be inside the range of Location Follow Large.

Tell me how you go!


P.S. I noticed you said you were worried about having to make lots of triggers for each unit your hero could possibly be. You can change the unit type to [men], so this way, no matter which unit your hero is, the trigger will still detect him and move him in. Note, if there are units that your player owns that you don't want to be able to enter buildings, then this solution won't work for you.

Post has been edited 5 time(s), last time on Jan 6 2011, 2:12 pm by private_parts.




Jan 6 2011, 5:10 pm Jesusfreak Post #11



Quote from name:private_parts
A method I have uses only two locations per building, instead of your four. As well as an additional 3 locations per player.
Location Inside (the place the player teleports to) 1 per building
Location Exit (the place the player goes to leave the building [indicated by beacon or terrain feature]) 1 per building
Location Teleport (the location the player teleports to when exiting the building) 1 per player
Location Follow Small (this location is always following the hero unit around, I suspect you already have this) 1 per player
Location Follow Large (this location is always following the hero unit around, I suspect you already have this) 1 per player

Not to be rude, but I've already said SEVERAL TIMES that I NEED to have the system work for MORE THAN ONE UNIT AT A TIME.

Quote
P.S. I noticed you said you were worried about having to make lots of triggers for each unit your hero could possibly be. You can change the unit type to [men], so this way, no matter which unit your hero is, the trigger will still detect him and move him in. Note, if there are units that your player owns that you don't want to be able to enter buildings, then this solution won't work for you.

Exactly. I would have used [men] if I had been able to.


I've already decided a few posts ago to go with the 4-location system. It has the least problems and I probably will have enough locations to make a suitable amount of buildings.



None.

Jan 6 2011, 5:43 pm Kaias Post #12



Or could you use a 2 location method and have a switch at either end (IE a nearby siege tank is given to the player when coming near the building, sieging it will send all units inside, where there too is a siege tank waiting to be sieged to send the units at the building exit back).

The switch could be killing a unit (that'd instantly respawn, of course), morphing a hydralisk into a lurker (this one is my favorite- if you're willing to not let the player be able to burrow then you can give him a burrowed hydra that he can't unburrow, making it so he can't move or abuse it. The burrowed hydra would appear next to the building if any units are near, and be removed if there aren't any. If the map is multiplayer and the players don't have vision of with each other they won't be able to see eachother's switches too), moving a unit (IE a civilian appears next to the building and the instant you move it it triggers the switch), morphing a mutalisk into a guardian/devourer, or unloading a bunker/dropship, for instance.



None.

Jan 7 2011, 4:37 am Vrael Post #13



Make 1 burrowed unit at the "entrance" to each building, then using triggers and a death count to keep track, cycle through each burrowed unit with an appropriate-sized location. If there are units at this location, move them (for appropriate players) to the correct interior based on the current DC.



None.

Jan 9 2011, 4:54 am Jesusfreak Post #14



Quote from Vrael
Make 1 burrowed unit at the "entrance" to each building, then using triggers and a death count to keep track, cycle through each burrowed unit with an appropriate-sized location. If there are units at this location, move them (for appropriate players) to the correct interior based on the current DC.

Hey, that sounds pretty good, I'll try that one if I start running short on locations :). I don't think I thought of that...

Quote
Or could you use a 2 location method and have a switch at either end (IE a nearby siege tank is given to the player when coming near the building, sieging it will send all units inside, where there too is a siege tank waiting to be sieged to send the units at the building exit back).

The switch could be killing a unit (that'd instantly respawn, of course), morphing a hydralisk into a lurker (this one is my favorite- if you're willing to not let the player be able to burrow then you can give him a burrowed hydra that he can't unburrow, making it so he can't move or abuse it. The burrowed hydra would appear next to the building if any units are near, and be removed if there aren't any. If the map is multiplayer and the players don't have vision of with each other they won't be able to see eachother's switches too), moving a unit (IE a civilian appears next to the building and the instant you move it it triggers the switch), morphing a mutalisk into a guardian/devourer, or unloading a bunker/dropship, for instance.

Not bad, I think I suggested something similar to this if not like it earlier... ah, I remember now:

Quote
3.) Have some sort of button to press (such as a reaver building scarabs) that the player could activate when they wanted to enter a building.

Advantages: Simple and easy to implement.
Allows the user to control when he enters a building, so that accidental entries are impossible.
Disadvantages: The player either would only be able to have one unit that could enter buildings, or a set of buttons for each building (which would require more locations, triggers, and space defeating the first advantage and giving it the same key flaw as system #1).
Stupid people probably wouldn't be able to figure it out.
It would be difficult to implement any secret buildings, since the player would probably have to be aware of them to take the initiative to press the button.




None.

Jan 9 2011, 3:27 pm Kaias Post #15



Quote from Jesusfreak
Not bad, I think I suggested something similar to this if not like it earlier... ah, I remember now:
The powers of skimming failed me. I think I probably stopped reading after you suggested using a physical marker for a switch instead of a switch for a switch, or immediately to a dc.

Quote from Jesusfreak
Disadvantages: The player either would only be able to have one unit that could enter buildings, or a set of buttons for each building (which would require more locations, triggers, and space defeating the first advantage and giving it the same key flaw as system #1).
It'd take slightly more space, which I'd call a nonissue, and I consider slightly more trigger-work a nonissue. Locations wouldn't be a problem if you made good use of burrowed units. But then again, locations aren't an issue for any of these if you make good use of burrowed units

Quote from Jesusfreak
Stupid people probably wouldn't be able to figure it out.
Probably the best argument against a button.

Quote from Jesusfreak
It would be difficult to implement any secret buildings, since the player would probably have to be aware of them to take the initiative to press the button.
This wouldn't need to be any more obvious than 4 location method if the button would appear at the entrance and only if you have a guy there to reveal it.

The biggest problem I see with the '4 location' method is that it takes up a lot of space and has to have two separate and distinguished exit/entrance. That is unless you're placing the location that you enter the building on a little more inward than the location to exit- in which case you're likely to have units in your army take of enough space that they're placed inside the exit.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
Please log in to shout.


Members Online: jun3hong, Roy