Anything to do with physics. Rigid Bodies, Kinematic controllers, vehicles etc.

Vehicle setup

Re: Vehicle setup

Postby SolarPortal » 18 Dec 2016, 22:25

Ellegant solution... i was wondering how you handled mapping world space to texture space :)

In the collision, i simply skip the next collision and then take the one after :)
I will try setup a demo over the next few days if time is available.
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Vehicle setup

Postby planetX » 19 Dec 2016, 17:47

Thanks, in fact is a quite simple concept: just find a relationship between the world and the map image. ;)

SolarPortal wrote:In the collision, i simply skip the next collision and then take the one after :)
I will try setup a demo over the next few days if time is available.


No problem, I finally solved it, just adding a hit counter: :D

Code: Select all
obj = 0;
wpID = 0;

hit = 0;

function onInit(objID)
   obj = objID;
   wpID = sky.getVar("wpID");
end

function onTrigger_Enter(HitID)

   tagname = entity.getTagFromID(HitID);
   
   if (tagname == "player") then
      hit = hit + 1;
   end
   
   if (hit == 1) then
      -- set global variables
      sky.setVar("Collision",1);
      sky.setVar("waypointID",wpID);
      sky.lprint("Waypoint: "..wpID);
   end

   if (hit > 1) then
      hit = 0;
   end
   
end

function onUpdate( td )
   -- set global variables
   sky.setVar("Collision",0);
end


Thanks very much for the hints!

Cheers

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Vehicle setup

Postby planetX » 30 Sep 2017, 06:00

Hi there,

I've just resurrected the race level I made with Gen1, got it mostly working again in Gen2.

But there's a message in the console which I'm getting since switched to Gen2:

Code: Select all
Failed to remove rigidbody as the id does not exist.


It appears when I stop the game, repeated 58 times, which is the number of triggers I create in runtime. Do you know why I get this?

Thanks in advance! ;)

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Vehicle setup

Postby lordalmighty1 » 30 Sep 2017, 10:57

ah good to see you making the racing game lvl for gen2 planetx gen1 version was looking cool, cant wait to see the 2nd gen version in action :D.
User avatar
lordalmighty1
Skyline Moderator
Skyline Moderator
 
Posts: 442
Joined: 02 Jan 2014, 12:13
Location: uk
Skill: Great creative
Skill: Level Designer

Re: Vehicle setup

Postby SolarPortal » 30 Sep 2017, 11:42

I agree with @la1, really happy you are on the racing now. It going to look awesome in Gen2!!!

As for that error message: This appears if you are trying to delete a rigidbody that has an ID less than 0, or if the physics body no longer exists in the arrays. My advice would be to simplify and find the bit causing it.
Q) Are you using the physics.removeBody().

It appears when I stop the game, repeated 58 times, which is the number of triggers I create in runtime. Do you know why I get this?

With the last version, there was changes to the action "PhysX Trigger Volume", so i can do some test myself with this :)

If it is an error, we will gladly take a look for you. If we can have a repeat process or the trigger preset you could send us, that would be great in trying to find the reason why it appears. :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Vehicle setup

Postby StarFire » 30 Sep 2017, 11:51

oh yeah! PlanetX
Looking forward to the new gen2 version racer, bet its going to be awesome :D
Dream the Journey, Live the Experience!
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: Vehicle setup

Postby planetX » 30 Sep 2017, 15:34

Ok, I'll try to explain what I'm doing... I'm creating a squence of waypoints based on the path nodes, which are going to be part of the race tracker. I do this by script when the level is initializing:

Code: Select all
   -- Create the waypoints
   for i=0,lastNode,5 do
      wpx,wpy,wpz = path.getNodePosition(pathName, i)
      nodeYaw = path.getNodeYaw(pathName, i)
      waypoint[i] = entity.spawn("MR_node",wpx,wpy,wpz,75,20,0.01)
      entity.setVisible(waypoint[i],0)
      entity.setRotation(waypoint[i],0,nodeYaw,0)
      if (i == 0) then
         entity.setMaterialName(waypoint[i], "MR_node_red")
      end
      physics.addTrigger(waypoint[i],1)
      sky.setVar("wpID",i/5) --set global var for each script
      entity.addScript(waypoint[i],"MR_race_trigger.lua")
   end


Each waypoint has its own script ("MR_race_trigger.lua"), which gets and sets some global variables, in order to detect when the car is passing through every waypoint:

Code: Select all
obj = 0
wp_ID = 0
hit = 0

function onInit(objID)
   obj = objID
   -- get global variable
   wp_ID = sky.getVar("wpID")
end

function onUpdate( td )
   -- set global variable
   sky.setVar("waypointCollision",0)
end

function onTrigger_Enter(HitID)
   tagname = entity.getTagFromID(HitID)
   if (tagname == "player") then
      hit = hit + 1
   end
   if (hit == 1) then
      -- set global variables
      sky.setVar("waypointCollision",1)
      sky.setVar("waypointID",wp_ID)
      sky.lprint("Waypoint: "..wp_ID)
   end
   if (hit > 1) then
      hit = 0
   end
end


That's basically... I think.

SolarPortal wrote:Q) Are you using the physics.removeBody().


No, the only rigidbodies atm are the car and the track.

SolarPortal wrote:With the last version, there was changes to the action "PhysX Trigger Volume", so i can do some test myself with this :)


I'm using the basic event from the API, no actions:

Code: Select all
function onTrigger_Enter(int hitID)
    sound.play2DSound( sound_ID );
end


Hope this helps to find the bug. If you need something else just shoot.

StarFire wrote:Looking forward to the new gen2 version racer, bet its going to be awesome :D


You bet it! I'm using the best engine ever created. ;)

Thanks!

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Vehicle setup

Postby SolarPortal » 30 Sep 2017, 17:01

You bet it! I'm using the best engine ever created. ;)

haha :P Great to hear that! :D

i think it could be to do with this line:
physics.addTrigger(waypoint[i],1)


which creates a bodyid, and i see not removal of this body, so will have to check that this is functioning correctly :)

thanks for the report ;)

Edit: You might find that this is not a bug, but looks that way on the surface as probably is deleted when the entity is removed and the print you see, is a physics system cleanup... but we shall find the root of the issue :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Vehicle setup

Postby planetX » 30 Sep 2017, 17:32

Great! :D

Have another question: is the gui.setPosY(bodyId, ElementID, y) function working? Just to check if I'm doing something wrong or not... I'm trying to move gui elements in one direction (vertical in this case), applying the same tweening function I used in the menu camera.

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Vehicle setup

Postby SolarPortal » 30 Sep 2017, 17:43

yes, it should be.. all it does is sets the RCSS property - "top".
just make sure your sending it through the lua command as a number and not a string :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Vehicle setup

Postby planetX » 15 Oct 2017, 17:16

Hi there,

made some progress on the race scene... basically playing with the HUD elements :D

What is working so far:
- Lap Counter
- Race Timer + Best Lap
- Speedometer
- Minimap, showing player and items
- Fuel/Health/Nitro/Record Info Panels

To Do:
- Standing (need ai cars)
- Tachometer
- Fuel and Nitro needles and systems

Hope you like it!


My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Vehicle setup

Postby StarFire » 15 Oct 2017, 17:35

Awesome to see this project move on , looks like its going to be a great game. Nice touch with the new ui moving up off the screen after pick up. Quality as always :D
Dream the Journey, Live the Experience!
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: Vehicle setup

Postby SolarPortal » 15 Oct 2017, 17:43

Great work planetX :) Amazing work as usual and great to see the racer in Gen2 looking really good :) :)
Shadows are quite close though arent they :P haha... (joke about Gen1 lol :P)
Love the sliding GUI overlay, works really well and the minimap i'm still jealous over lol...

I think it would be good to start posting about your game(lastest gui vide and racing vid) in the http://www.forum.aurasoft-skyline.co.uk/viewforum.php?f=9 (which showcases will be moved onto the root of the forum for quicker access).
also post it on the #project_showcase on the discord chat as i'm sure they would love to see it on there also :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Vehicle setup

Postby lordalmighty1 » 15 Oct 2017, 18:59

nice m8, looking super :)
User avatar
lordalmighty1
Skyline Moderator
Skyline Moderator
 
Posts: 442
Joined: 02 Jan 2014, 12:13
Location: uk
Skill: Great creative
Skill: Level Designer

Re: Vehicle setup

Postby planetX » 15 Oct 2017, 19:54

Thanks guys, glad you like it... I really enjoy the engine. :D

Ok, next time I'll post in the showcase. ;)

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Vehicle setup

Postby SolarPortal » 15 Oct 2017, 20:04

I really enjoy the engine. :D

Really great to hear that and see something cool being made with it also :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Vehicle setup

Postby SolarPortal » 16 Oct 2017, 15:37

A new showcase forum has been setup on the root of the forum here: http://www.forum.aurasoft-skyline.co.uk/viewforum.php?f=67
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Vehicle setup

Postby planetX » 16 Oct 2017, 19:09

Done, Sir! ;)

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Previous

Return to Physics

Who is online

Users browsing this forum: No registered users and 1 guest