Jump to content

Roads in code


Laurens
 Share

Recommended Posts

Hi guys and gals (do we have any?),

 

Last night I was playing Railroads and was thinking about how the new Editor got this nice new road system. That got me thinking about whether or not it is possible to lay roads programmatically (C++, or whatever language). Is it possible to do so? If not you would just be reinventing the wheel since Josh already did such a good job on them.

 

Cheers!

Link to comment
Share on other sites

Just curious, but what would be the advantage?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Just curious, but what would be the advantage?

 

Because it would enable players to lay railroads for instance while playing the game. Hence the reference to Railroads. Although I agree I wasn't to clear on that.

 

You can do it quite easily. Just create programmatically a sbx file and then load it.

 

That would work. But can be it be done without reloading an entire scene?

Link to comment
Share on other sites

Because it would enable players to lay railroads for instance while playing the game. Hence the reference to Railroads. Although I agree I wasn't to clear on that.

 

 

 

That would work. But can be it be done without reloading an entire scene?

 

yes it can be done, you just have to program it to do so...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Well obviously, but I was wondering if it were somehow possible to use the nodes that Josh created, those that are being used in Editor.

 

a modified version of it i would guess... you could try spawning them with a camerapick and see what you get... the problem you need to work out is how to adjust the rotation and handle the linking via your game instead of the editor.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

A sbx file doesn't have to be a complete scene, you can also load multiple sbx files, each having some other parts.

All LoadScene does is to add entities to the world, it doesn't delete old entities .

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

A sbx file doesn't have to be a complete scene, you can also load multiple sbx files, each having some other parts.

All LoadScene does is to add entities to the world, it doesn't delete old entities .

 

In this context, whats the benefit of loading a SBX file as compared to just loading a model?

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

You could also load the models, but with sbx you could open the scene in editor and adjust some road nodes, and then paste the code back to your C++ program.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

You could also load the models, but with sbx you could open the scene in editor and adjust some road nodes, and then paste the code back to your C++ program.

That would be fine for the developer to do, but the goal here was for the end-user(player) to be able to spawn railroad tracks. Since the player will not have the SDK, the smart thing to do would do this by lua script to automatically spawn your type of track, line up your tracks, etc...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Because it would enable players to lay railroads for instance while playing the game. Hence the reference to Railroads. Although I agree I wasn't to clear on that.

 

 

ok, no it wasn't that clear but I see where you are coming from now :D

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...