Aller au contenu

Photo

Generic placeable movement, useful?


  • Veuillez vous connecter pour répondre
19 réponses à ce sujet

#1
kamal_

kamal_
  • Members
  • 5 254 messages
I was investingating how M. Reider made a placeable fall from the ceiling and realized I could make his hardcoded scripts into a more generic system to make placeables fall.

With some experimenting I got a generic group of placeables to fall. Then I realized there's no real limit there and I should be able to move and rotate placeables however I programmed in. Would people like to see it developed?

#2
kamal_

kamal_
  • Members
  • 5 254 messages
Let me clarify a bit on what I have done.

I can draw a trigger on the ground, and have all placeables with any given string in their tags fall. If a placeable in the trigger does not have the string in it's tag, it does not fall. So for example you could start a tag with "fall_" or "move_" or whatever you want, and just pass that part of the tag to the script. You do not have to code each placeable separately.

The original code is set up only for falling straight down. But M.Reider used vector math (essentially, vector math allow you to add x,y,z coordinates and directions and get a new set of x,y,z coordinates), which allows generating new coordinates anywhere relative to the old position.

The placeables don't actually move, they get rapidly created and destroyed along the series of coordinates laid out by the vector math. This gives the illusion of movement. The code currently only generates a move down along the z axis (and accelerates it to simulate gravity), but changing the code would allow movement along any arbitrary line, and further changing it would allow curved paths (limited by your ability to mathematically describe the path, though you should be able to string together scripts to follow a curve to a spot, then adopt a straight line for example, or to reverse course). The acceleration is likewise currently just a static number but could have math formulas applied, you could make something that oscillates back and forth like a pendulum. Finally, there was no code for the facing of the placeable, code could be added to control facing as well.

Practical example: with all the above, you could make a ship that sailed around in circle. Or a wall that moved back and forth like a Pong paddle. Or an actual "bouncy rock" ;)

#3
kevL

kevL
  • Members
  • 4 070 messages
this sounds interesting, Kam_

can't say i have an immediate use for it but like the C-ai, I'd store it in my arsenal

#4
kamal_

kamal_
  • Members
  • 5 254 messages
Before anyone thinks to ask, when I said "rotate placeables", I mean change their facing (rotate on z axis), not change their angle versus a flat ground plane (rotate on x or y axis). No tilting a house to stick on the side of a cliff.

#5
kevL

kevL
  • Members
  • 4 070 messages

kamal_ wrote...

... No tilting a house to stick on the side of a cliff.

well maybe

MDB manipulation tool

#6
Shaughn78

Shaughn78
  • Members
  • 637 messages
I like it, and I may have to go back to a few things. Previously I just used sound effects and a shaking screen to make the appearance of something falling.

#7
rjshae

rjshae
  • Members
  • 4 497 messages
Perhaps useful for siege projectiles?

#8
kamal_

kamal_
  • Members
  • 5 254 messages

rjshae wrote...

Perhaps useful for siege projectiles?

We've already got the "throwing boulders" for doing seige projectiles, though this could do a battering ram. Once I get to the point where I can make a placeable move back and forth on the x/y axis I will put in a dynamic walkmesh placeable to test with. The rapid create/destroy might do bad things with a dynamic walkmesh placeable.

Right now I'm working on getting the information for the scripts stored on the trigger. It's not that different from how I did the commoner ai, except a trigger instead of ipoints. So currently I can only make things fall down (actually as of this post I've broken that as I'm abstracting out to the trigger for the variable storage).

#9
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
Would it be possible to crash a ship ?

I was thinking of using an earthquake on the people inside then just teleporting them to a beach but a cutscene would be rather nice. I could jump the PC and his gang under the water into a trigger if that's what's necessary then set the cameras pointing at the ship and make a conversation that you have to click through so there's no chance of swimming off by the player. I just wondered if a ship is too complex to keep deleting and respawning fast enough so it's not jumping about.

#10
kamal_

kamal_
  • Members
  • 5 254 messages
I would expect moving a ship to be fine, I can test that specifically if you'd like. In my test area I am using four different boulder placeables and moving them all at once, not seeing any lag from that.

Crashing a ship would be essentially straight line movement of a given distance. That's what the original code does (albeit hardcoded to move down). So from a technical perspective I'd say no problem once I got things working. You could already use M.Reider's original code with minor changes.

#11
kamal_

kamal_
  • Members
  • 5 254 messages
I'm thinking handling defining movement patterns and facing via string, so as a builder you would tell it "circle" and "FacePC" for instance. Then the distance to move variable would control the size of the circle, and the x/y/z would control the direction to make that circle in. I'd define the math for the "circle" function, and the animation function would run the circle function code for the movement pattern, and the facePC function for the facing part of the animation.

Doing it this way would allow a builder to add custom movement functions, like "figure8" or whatever, and the system would work as long as they wrote a function to describe a figure8.

#12
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
Sounds good to me, don't worry about specifically testing a ship though just do what you fancy. But it sounds interesting you could even have a flying carpet that you have to chase around to get the treasure on top.

#13
Tchos

Tchos
  • Members
  • 5 063 messages
I'd love to see a video of this in action.

#14
kamal_

kamal_
  • Members
  • 5 254 messages
I'll put one up when I fix the part I broke. It you played Wizard's Apprentice 2, M.Reider used it on the icicle at the cave exit.

#15
kamal_

kamal_
  • Members
  • 5 254 messages

Tchos wrote...

I'd love to see a video of this in action.

Standard disclaimers about this being unfinished code etc.
www.youtube.com/watch

I have linear movement in any direction along the x/y axis also working.

Modifié par kamal_, 18 septembre 2012 - 11:13 .


#16
Dann-J

Dann-J
  • Members
  • 3 161 messages
For a lot of these sort of effects, you could create a model effect that automatically incorporates the movement into it (like the SoZ flock of gulls) rather than use actual placeables. The downside is that the movement direction, rate and distance is then hard-coded into the effect, so it's not as flexible as the scripted solution.

There was a sinking ship cut scene in the OC that used the ship creature appearance. That's another option for creating moving placeables - especially if they only occur in cut scenes where you can't cursor over the 'creature'.

#17
kamal_

kamal_
  • Members
  • 5 254 messages

DannJ wrote...

For a lot of these sort of effects, you could create a model effect that automatically incorporates the movement into it (like the SoZ flock of gulls) rather than use actual placeables. The downside is that the movement direction, rate and distance is then hard-coded into the effect, so it's not as flexible as the scripted solution.

There was a sinking ship cut scene in the OC that used the ship creature appearance. That's another option for creating moving placeables - especially if they only occur in cut scenes where you can't cursor over the 'creature'.

This way is more fun :P, and allows movement in non walkable area. And it's actually going to be easier to use for people than making custom vfx.

There's lots of creative uses I can think of, slowly dropping spiked ceiling  or Star Wars trash compactor style closing wall traps. Make a "can't go backwards" maze by having a placeable follow the pc. Slide placeables out of the way to reveal an opening. Making placeables grow from small to big or vice versa. Putting the player in a "stagecoach" decorated tile and moving placeables past the windows in a square movement to simulate a moving wagon (the players eye will interpret the pc as moving and the placeables as still). Make players chase the button they need to press around the dungeon.

I've added some prelimiary turning, but it is just going to the end of the turn and not showing the intermediate. I've also added some prelimiary code for controlling how long to take for the move, scaling the placeable, and not destroying it at the end of the move, which aren't working yet.

Modifié par kamal_, 19 septembre 2012 - 01:34 .


#18
kamal_

kamal_
  • Members
  • 5 254 messages
Turn and move at the same time now works.

#19
Tchos

Tchos
  • Members
  • 5 063 messages
Hey, I like that stagecoach idea!

#20
kamal_

kamal_
  • Members
  • 5 254 messages
Iveforgotmypassword requested a ship, so here's two. This video demonstrates linear movement, placeable rotation (facing), and scaling. Like my commoner ai, this is designed to be simple and quick to set up for a builder. With the readme, builders should be able to create these same effects in 5-10 minutes, since no scripting is required. There are PW's with systems to control placeables, but I'd never seen anything released for the SP builder.

youtube

Initial Demo:
demo
Initial readme:
readme
Initial erf, includes script, sample placeable and trigger blueprints:
erf

-----------------
edit:
added automatic retagging, so you can place a group of objects in the trigger and they don't all have to have individual tagged, making it easier for a builder to handle groups of objects. Since it adds a tag suffix, no more problem with ensuring the tag doesn't end in a number.

Modifié par kamal_, 22 septembre 2012 - 02:14 .