View RSS Feed

All Blog Entries

  1. Step one complete, now for step two

    by
    Aperion
    , 02-08-13 at 05:26 AM
    This is a follow up post to my previous one about refactoring and my plan forward.

    I have completed the first item in my list
    Way Forward (aka the plan)
    1. Replace slidenode code with outside drive-train code - Completed
    2. Refactor current wheel calculation - in progress
    3. Rewrite current drive-train to make use of new code
    4. Add new drive train features


    Here is what I wrote about the next step here:
    Refactor current wheel calculation
    Current wheels aren't very reliable, we average the speed of each node to calculate the rotation of the wheel, this is subject to fluctuation. Instead I will have one object that represents the wheel as a whole, it acts more like a traditional tire model in a game where it's simply a cylinder. This is very similar to slidenodes is that there is an ideal state, and a state the wheels actually are at.

    I'm expecting this to help solve a few issues RoR currently faces such as vehicles slipping down a slop when they should be braked. Also under this approach folding wheels should be a thing of the past.
    I am kind of gathering my thoughts on how to approach this step, and how to explain it. There are essentially two "worlds" I'll be dealing with, a beam world and a drive-train world. the beam world is the one we are familiar with, point masses held together by springs in a 3D space. The drive-train world is made of point masses held together by springs in a 1D space. So where nodes have an [x,y,z] coordinates drive-train components simply have an angle. Essentially the drive-train world is the beam world with different dimensions and units.

    So what the next step needs is translating from 1D to 3D and back. The angle in the drivetrain world will correspond to the angle offset each node is from it's original position, the hard part is how do you account for the wheel being at any odd angle? Possibly even upside down. Come to think of it, I remember now what my solution was, this is actually why I write these posts, to help me think.

    What we know is each nodes initial starting position and the current position of the axle nodes and each wheel node. If we find the rotation required to translate the axle to it's original postion we can then apply that transformation to the current wheel node position. Then use the translated current wheel node position, the center axle and the initial node position we can calculate the current angle difference from the initial position. This can then be used to calculate difference between where the node is supposed to be based on the drive-train world, and where it actually is.

    I did write a tiny program just to test this out:
    Code:
    #include <iostream>
    #include <OGRE/Ogre.h>
    
    int main()
    {
    
    	Ogre::Vector3 pn1(1, 0, 0);
    	Ogre::Vector3 pn3(1, 0, 1);
    	
    	Ogre::Vector3 n2(0, 0, 0);
    	Ogre::Vector3 n1(0, 1, 0);
    	Ogre::Vector3 n3(-1, 1, 1);
    	Ogre::Quaternion rot;
    
    	 // move nodes to origin...
    	n1 -= n2;
    	n3 -= n2;
    	
    	// get rotation
    	rot = n1.getRotationTo(pn1.normalisedCopy());
    	
    	// move spoke to origin for rotation
    	n3 -= n1;
    	n3 = rot * n3;
    	
    	std::cout << Ogre::Degree((pn3 - pn1).angleBetween(n3));
    	return 0;
    }
    We'll see how logn this takes to get done. night night.
    Categories
    Development
  2. Refactoring slidenodes, drivetrain, and framework

    by
    Aperion
    , 01-28-13 at 10:53 PM
    Since I've been doing some coding I thought I'd share what I'm working on. First and foremost my goal right now is to rework the drive-train code, this includes the tires. But I am sort of taking a round about approach to this which includes some pretty heavy refactoring. I've written a lot of concept code in the past for a new drive-train but never put it to use. I also wrote it in a reusable manner and am expanding this design.

    History
    The drive-train code I did write works on it's own, it just needed to be integrated into RoR. The new drive train code is built on the same principle as RoR, nodes and beams. Instead of nodes and beam in a 3 dimensional space we have nodes and beams in a 1 dimensional space. replace position with angle, velocity with moment, and force with torque and you have the same equations. This is where I started.

    So I am basically building a parallel "world" for the drive train that works similar to nodes and beams. My starting point was going to be the wheels, since they essentially act like the gate way between the node/beam world and the drive-train world. My approach here is to simulate a drive-train wheel object which is nothing more than an an angle, then calculate where the nodes should be positioned based on that angle. While I was working on this, I realized that this is drive-train same concept I'm using for slide nodes: calculate where a node should be, calculate beam-like forces from where the node is, and where the node should be and distribute forces appropriately. So I started hacking away at some concept that I could use for both when I dawned on me that I had already written this code a long time ago for the drive train.

    Theory
    So here is a bit about my theory behind the drive-train code, and what will most likely be used in many many more places than the drive-train. As I've worked in the BeamForcesEuler routine I've realized that it boils down to two actions, updating the forces that act on a node, and updating the nodes position. I call them sources, and sinks; sources generate/calculate the forces based on the environment and are applied to the sinks, the sinks take the forces and decide what to do with them. In RoR terms sources are beams, engine, wings, commands, collisions, etc, etc, and sinks are nodes.

    One of the cool ideas I will be able to introduce with this new idea is per-node integrators, I feel this will be handy because some weight/spring combinations are not stable but would be if a different integration method is used.

    Way Forward (aka the plan)
    1. Replace slidenode code with outside drive-train code
    2. Refactor current wheel calculation
    3. Rewrite current drive-train to make use of new code
    4. Add new drive train features


    Replace slidenode code with outside drive-train code
    I'm doing this first because it's an existing system so I will be able to just test out the new code against existing slide node behavior to tell if it is working. This will be the biggest change all other items will make use of the concepts implemented here.

    Refactoring this code will also have the added benefit of slide node damping since it's already built into the code I will be integrating.

    Refactor current wheel calculation
    Current wheels aren't very reliable, we average the speed of each node to calculate the rotation of the wheel, this is subject to fluctuation. Instead I will have one object that represents the wheel as a whole, it acts more like a traditional tire model in a game where it's simply a cylinder. This is very similar to slidenodes is that there is an ideal state, and a state the wheels actually are at.

    I'm expecting this to help solve a few issues RoR currently faces such as vehicles slipping down a slop when they should be braked. Also under this approach folding wheels should be a thing of the past.

    Rewrite current drive-train to make use of new code
    Make sure the current drive train code works and behaves as is with the new wheel model, and make use of new code to perform drive train calculations. The current code is a bit of a mess and there is a bug where the first two axles are locked together but none others, this should solve that problem.

    Add new drive train features
    Multiple engines, torque converters, clutches, lockers, limited slip, multiple gear boxes, transfer-case, brakes, etc

    My goal here is to model any and all kinds of different power, be it a traditional engine and 4 wheels, a parallel hybrid with two different engine types, or a helicopter with one engine powering two different rotors. Or who knows what. I want to flip over a car, spin one wheel with the mouse and watch the other wheel spin in the opposite direction when using an open diff. the best part IMO is that I've already got some of this working. I've test locked, open, and LS diffs. I've tested with one power source, and I've tested with two power sources.

    And Beyond!
    I plan on using this framework throughout RoR, hoping to achieve better performance, multiprocessor support, more organized, and easier to alter.

    I'm excited

    My work and progress is viewable here: http://sourceforge.net/u/aperion/rig...0fd7a443/tree/
    What I will be using for much of my refactoring is here: http://sourceforge.net/u/aperion/rig...ics/framework/
    Categories
    Development
  3. Awesomely-edited video!

    by
    Beolex
    , 01-28-13 at 03:41 AM


    Thanks to Jaimswallace for the cool video.

    Original link: The-ultimate-Crash-Compilation-ep-14-Less-CC-More-Crashes

    I have everything I need to edit videos: Rigs of Rods, tons of recording software, and Sony Vegas. But one thing I don't have is motivation to make decent videos. This is why I congratulate Jaimswallace.
    Categories
    Uncategorized
  4. Sourceforge "Project of the month" November 2012

    by
    tdev
    , 11-01-12 at 10:59 PM
    We are the "Project of the month November 2012" on Sourceforge.net.
    More details: Sourceforge-Project-of-the-month-November-2012
    Categories
    Official News
  5. ROR and the Raspberry Pi

    by
    tdev
    , 10-27-12 at 12:27 PM
    A developer from our team (theshark) used his Raspberry Pi to display gauges for RoR



    Original Post (in german)

    Updated 10-27-12 at 12:30 PM by tdev

    Categories
    Official News
  6. On-line race ranking massive development

    by
    DeGa
    , 09-21-12 at 07:54 PM
    Thomas is wonderful! That being said...



    Have a look at the Multiplayer tab if you didn't have a chance those last days/weeks/months

    A major improvement in the game, in my opinion, is the recent development of on-line timescores.



    If you're not familiar with it yet,
    let me guide you through

    Begin by clicking the multiplayer tab of the forum.


    You'll arrive to a fancy page with a lot of icons



    • Understand how to race (it's not hard, really)




    • Access your personal times (go here if you don't know how to race)





    • See the latest changes in the leaderboards





    • See some key figures, updated real-time - you can see that it's pretty succesful already, looks like you like racing ;-)




    And a brand new functionnality, every user gets a global ranking! You can now access it by clicking this fancy button:



    It will get you to a global chart with a lot of information, and the global ranking! There is a ultra-secret formula to compute it.
    "Some say" that it accounts, amongst others, for the mass of sweat you produced when racing...

    You can sort it by the criteria you like, for example the amount of races done ever:


    If you want to know a bit more about a competitor, or see your own medals and palmares, click a user name:




    It will get you to the profile page, where you'll have noticed that you have a new tab called "races", where you can see all your medals:

    You want more people? OK, you can track yourself, or someone else by viewing all the data, and sorting it how you like by clicking on the button at the bottom of the page "view all data".



    The race system itself is full of functionnalities!

    It is now possible to set

    • Vehicle-specific challenge





    • Only verified vehicles races (only the vehicles currently available in the repository)



    Then again, a lot of info for you to analyze, such as graphic illustration of the quality of each section of the race



    it's green - you did a good time in that section
    it's red - well, you know what it means, don't you?

    And you can comment your laps and linking to a video of it 8-| That's just great!




    So you're making maps

    If you have uploaded a terrain on the repository, and you'd like some on-line leaderboards to be created for you, contact me (DeGa) through PM.
    Know that:


    • You will need to provide 1 image per race, uploaded in a public place (nothing related to rigs of rods forums), closest from 16:9 ratio, min 500*300
    • You will need to race all your races yourself, and make sure that your times land here
    • Race the EXACT version you uploaded on the repository (best practice is to upload, download this exact file, race it)
    • Include in your PM if you would like to have vehicle-specific races - in this case, again, race this exact race, with this exact vehicle
    • Be polite ;-)


    If you're used to publish maps for RoR, you will be given direct access to the management of your races.

    Updated 10-08-12 at 05:05 PM by DeGa

    Categories
    Official News
  7. POC Tech Demo: The DiveAmant, Dive Technology without cheating

    by
    tdev
    , 09-06-12 at 09:32 AM
    Quote Originally Posted by simpeligent View Post


    this is the floating hull

    Click image for larger version. 

Name:	DiveAmant-Hull-01.png 
Views:	442 
Size:	130.9 KB 
ID:	342320Click image for larger version. 

Name:	DiveAmant-Hull-02.png 
Views:	432 
Size:	119.9 KB 
ID:	342319Click image for larger version. 

Name:	DiveAmant-Hull-03.png 
Views:	455 
Size:	137.5 KB 
ID:	342318


    on the left is the swimming position - on the right, the fully contracted dive position..

    Function Principle:
    it has a pre defined weight but it can change it's volume - there fore change it's density..

    it is as close as you can get in to the real thing in ROR..
    The Diamant is the ROR equivalent to the pressurechambers in a real sub..
    They change the density by pressing out water and replace it with air (or vice versa)
    I do it with the change of volume - it results in the same:
    different density/water displacement force for the hull

    the N/B structure is quite simple and can be replicated easely or even imported in your project..
    add DiveAmant as dive core to any contraption, you want to be able to dive with..

    it is possible to combine more than one - for example to make a plattform with one on every corner..
    to increase the lifting power, simple scale it to your needs..

    It is suggested to keep the shape intact and symetrical..
    ..or you might get some spinning problems

    Also this diamant shape spinned under too much pressure..
    Several vertically placed stabilizer wings did stop that eventually..

    the complete N/B is invisble for conveniant usage in your project - but you can easely change the beams to visible and the hull has a texture-space defined, that is commented out..
    so if you need to see, what is going on, uncomment that

    Iin a few minutes, I will upload a working prototype with engines, to the repo - so you can download and start right away with submarine development
    Edit: done
    http://www.rigsofrods.com/repository/view/4757
    waiting for approval..

    good luck - questions - post below..

    Have fun..
    and real submarines

    comment in the original thread: POC-Tech-Demo-The-DiveAmant-Dive-Technology-without-cheating
    Categories
    Uncategorized
  8. Motorbike tech-demo and tutorial

    by
    tdev
    , 08-15-12 at 12:14 AM
    Quote Originally Posted by Davded View Post
    So... erm, yeah.
    This started as a proof of concept a few months ago and I was very surprised when it actually worked.
    Inspired by "This is RoR, everything is possible (except Motorbikes)" - Nadeox1 and with some discussion with Creak, I decided to work on it a bit more.
    This is what I have learned, and there is no point keeping it to myself.

    The concept and explaination;

    Motorbikes are counter-intuitive, to turn left, you must steer right a little first and vice-versa. It is because of this that the player cannot control the steering directly (with hydros) because the response time is too long and there is no feedback like when you ride a bicycle. So you must use animators and the "roll" option. This is what we use to turn the front wheel.

    The roll means the angle between the camera plane and the ground plane, so you can adjust it buy rotating the camera. This is the main way of controlling the bike, you essentialy trick the bike into thinking its falling onto one side and it will always try to be level. In other words, you're not steering, just controlling the lean angle.

    A shiny picture to adhere to people with short attention spans;




    Design points;

    Weight;
    Due to RoR I didnt bother trying to get my bike too light, It wasn't a key issue.

    Engine;
    The bike I have provided is sort of a low geared, lightweight racing bike, enough power to pop a wheelie in first gear if you drop the clutch but will top out at about 200kph.

    Suspension;
    Should be quite stiff with high damping to stop the bike bouncing and jigglying around. Any shaking is bad for the stabilization and control.

    Wheels;
    The wheels should be as thin as possible and be made very stiff to stop flexing. I added a snode out to the side for both front and back wheels to stop them form flexing so much.

    I cheated and increase the grip for both wheels, because RoR is designed for heavy trucks.
    Code:
    set_node_defaults -1, 3, -1, -1
    Was inserted before the wheels section, stops wheel spin and although drifting in the bike was amazing, it wasn't good for control or cornering

    Steering;
    The steering assembly is able to move up and down with the suspension on slide nodes and controls the balance of the bike.

    There are four animators that form a sort to diamond shape they are defined something like this;
    Code:
    29, 34, 1, roll | shortlimit: 0.15 | longlimit: 0.15
    Note how the short and long limit are quite small, you don't need a large number because the castor angle on the front wheel helps the bike turn when it is in a lean.
    Truck_Description_File#Animators

    Camera;
    You can control the lean angle of the bike by controlling the lean angle of the camera, and you do this using hydros. I recommend trying about 20 deg then gradually increasing until a balance between control and stability is found. Offroad bikes should have less because of lower grip.

    Stopping
    I made the brakes quite strong
    I Have used animators with the option "Parking brake", this is so when you stop just apply the parking brake and "legs" will drop down and stop the bike from falling.

    Controls
    To control the bike you just steer as if it were a car, but try to be gentle as sharp movements will upset the bike just like with real life.
    To steer sharper, just slow down, there is a sweet spot between 30 and 60 mph were there is great handling.
    To pop a wheelie, either put the bike in neutral, full revs then change to first, or better, switch to fully manual and drop the clutch.



    I suspect I have missed something out, but oh well.

    Thanks for reading and be sure to test the .truck file. I recommend large open maps, like that N-labs terrain or bajatrack in the screenshots.
    Be sure to post your mods etc. below and well as ask for advice if you want to do your own. I may wikifi this depending on the response.
    Awesome, first good bike in RoR! Great work

    Original thread (comment there): Motorbike-tech-demo-and-tutorial
    Categories
    Projects , Vehicles
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	screenshot_239.jpg 
Views:	642 
Size:	67.5 KB 
ID:	337753  Click image for larger version. 

Name:	screenshot_243.jpg 
Views:	457 
Size:	85.9 KB 
ID:	337754  Click image for larger version. 

Name:	screenshot_244.jpg 
Views:	364 
Size:	82.0 KB 
ID:	337755  Click image for larger version. 

Name:	screenshot_241.jpg 
Views:	464 
Size:	76.1 KB 
ID:	337756 
    Attached Thumbnails Attached Files
Page 2 of 23 FirstFirst 123412 ... LastLast


About Rigs of Rods

    Rigs of Rods is a unique soft body physics simulator.


Some Tools


Partners


Follow us

Twitter youtube Facebook RSS Feed


impressum