This is my first attempt to create some sort of modular design for a physics-driven machine in Blender.
Modular elements so far
Horizontal slides
Slopes (slides with an angle) + Curves (Straight)
Spirals
Dropper (basically a hole in a slide)
Shooter takes a ball that drops in from above (e.g from a Dropper) and redirects it into a horizontal motion again. This one has the special property of rotating 90 degrees (forward&back) each time a ball has passed trough. Also slows down a passing-trough ball.
Bumper + Catcher (Shooter bumps a ball vertically into the air and the Catcher redirects it into a horizontal motion again)
Teleporter and Teleporter-Target (the target can be any object)
Colorizer - This little gizmo changes the mesh/colour of the ball when activated. This is the first script i had to separate into two script-files in order to work. See ācolorizerā & "colorizer2"UPDATE8 2007-01-30: You can download the most recent blend file here.
TODOs
[DONE] I still have some problems with the Bumper since they behave differently every time I use them (caused by small differences in the physics-calculation) and i need to figure out a way to āaimā or āguideā the spheres a bit.
[OPEN] I still need to figure out how to display the exchanged meshes correctly. They currently are on layer 2 and are drawn āshadelessā when exchanged.This thread is a follow-up on two other (problem driven) threads of mine - where my progress in the GE is documented quite well
reusing scripts (was helpful when creating the āmain.pyā file - donāt call it āglobalā btw ;))Comments, critics and suggestions welcome,
Werner
Screenshot, .blend, clear intentionā¦perfect. I just want to commend you for taking the time to post right, it just made my day. Thanks.
That said, I like the look and feel of your marble machine. There are still some mechanics issues (like when the balls misalign with certain pipes, and go āoverboardā), however Iām sure thatās something that can be tweaked out quite easily.
Are you doing this for the new Bullet competition?
If so, I think this is a pretty good start toward a contender.
The contest was definitely an inspiration to play with the GE again, but Iām not sure if I can get something complete up in time.
So Iām most probably not going to enter the contest - anybody feel free to salvage parts of my stuff (as long as the result goes back to the blender community ;))
My dream-come-true would be if the āplayerā could place all these modules himself ala āincredible machinesā, but thatās an aim to far in the future (and way beyond my current skills) to be realistic right now.
is there any way you can make the spheres sit longer before they are launched? it seems they arenāt all the way ālockedā into place before they get shot, which is causing them to fly wrong, what if you took the launcher and made the hole deeper, so the ball canāt move back and forth, and then when it launches, it will launch straight.
btw, very nice concept, I am going to play around with it if you donāt mind
Overboard: I noticed that too, but this depends heavily on the machine (and blender version) i run it on. On some combinations nothing runs overboard, on others it"s pure chaos - seems like the physics code is heavily CPU/computer dependent
EDIT: What i actually want to say is that tweaking it might help for one system, but one needs to check it everywhere else as well continuously.
The only constant problem i see is the mis-aiming of the āBumpersā when shooting balls into the air (as mentioned in my fist post). Anybody got ideas how to stabilize the flight of the ball?.
Werner
On a related note: A āGame Engine WIPsā forum or something like that as s/b mentioned elsewhere would really be a good idea.
Making the time longer is easy enough, just change the ticks value f:10 to 30 or higher in the āball_pulseā sensor(s) - doesnāt help much (here at this comp)
I also fiddled around with the shape of the bumper, but nothing really helps, the ball just has some āfuzzynessā when launched
btw, very nice concept, I am going to play around with it if you donāt mind
Sure as i mentioned earlier Go ahead and improve on it
Ok, i think i found a fairly good solution of the bumper (sans the fine-tuning), but i ran into some problems ā¦ first the script Iām using that is connected to a collision sensor:
# Get the script-controller
co = GameLogic.getCurrentController()
# Get the collision sensor the script-controller is linked to (assumes there is only one - thus it's a precondition when making logic blocks).
sensors = co.getSensors()
sens = sensors[0]
# Get the object the sensor is assigned to (inner part of the "bumper").
#obj = co.getOwner()
obj2 = sens.getOwner()
# Get the location of the "bumper" object.
location = obj2.getPosition()
# Gets the object that has touched the "bumper".
obj_ball = sens.getHitObject()
# Place Ball on top of the "bumper"
obj_ball.setPosition([location[0],location[1]+5,location[2]])
# Bump the ball upwards.
obj_ball.applyImpulse(obj_ball.getPosition(),[0,0,20])
Two questions remain:
How do i prevent āNoneTypeā objects from executing the last two comamnds (i.e. how do i check for ā!=NoneTypeā)?
[EDIT: Nevermind, found my error] Why is collision suddenly not active for the ball after executing āapplyImpulseā (i.e. the ball is passing right trough the ācatcherā)?
Added a teleporter and teleporter-target (the target can be any object btw). One defines the name of the target-object in the properties of the teleporter-sensor.
You can download the most recent blend file from the link in the original post.
Would it make sense to create āassemby lineā or ātrackā component to the kit? It could be active all the time or activated when ball hits it. See tracktest.blend for better reference about what I mean by āassembly lineā. http://mediawiki.blender.org/index.php/Release_Notes/Notes243/Modifiers
hey nice workā¦ just downloaded it. .seems to work farely wellā¦ sometime the balls drop off the bottom right side curveā¦ you should enter it in the competition
I added a slowdown script to the shooter so the ball isnāt thrown trough the air as often (it can still happen if the balls drop in too fas after each other though).
You can download the most recent blend file from the link in the original post.
Band-conveyor: Good idea, but I think array-modifiers do not work in the GE or am I wrong? Dunno if I wanna do this much work
Added the possibility to rotate the camera (left+right cursor key), a small fix (slower) so the āstarterā doesnāt work as a spoilsport and a readme with some info on the file.
You can download the most recent blend file from the link in the original post.
I added a new element: The Colorizer ā¦ This little gizmo changes the mesh/color of the ball when activated. This is the first script i had to seperate into two script-files in order to work. See ācolorizerā & ācolorizer2ā in the file.
I still need to figure out how to display the exchanged meshes correctly. They currently are on layer 2 and are drawn āshadelessā when exchanged.
I could place them on the first layer, but this isnāt really a good (it gets crowded there without them already) solution - any tips?
You can download the most recent blend file from the link in the original post.
EDIT: This version (i.e. the colorizer in slopes17.blend) does not seem to work with blender 2.43 RC1 (didnāt have time to check others) tough it works fine in 2.42a. Iāll look into this.
Added a resurrection point for balls that fell of the slides (or the shooter which is the weak link in the chain right now). It uses the āteleporterā script with just another target (defined in the properties).
By itself this wouldnāt even be worth a message in this thread, but i also added an additional logic=brick counter that tells you how many balls touched the ground.
This little GE blend file of mine now has a goal ā¦ keep the resurrection number at zero without spending a lot of work into the logic & structure
This is the most in-deep interaction youāll ever get out of a game ā¦ fiddling with the game(-code) itself (codewars comes to mind :))
EDIT: Longest run that Iāve stopped was 19 minutes with 10 resurrections.
You can download the most recent blend file from the link in the original post.
Not exactly ā¦ if I would need to make defined rules of the game i would state it like ā¦ āModify the shooter (with as few changes as possible) so no ball is dropped (0 resurrections) at all in a time-frame of 20 minutes ā¦ in the default setup.ā So the aim in the default āgameā is to make the elements work as expected
Of course thatās just a suggestion ā¦ Iām looking forward to the results if you create your own slides&slopes setups
Status update: Iām playing with the idea to make modules that work similar to quake3-style jump-pads (using the ābumperā code) but I donāt have much time right now.