Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Ship Building Games?  (Read 902 times)
0 Members and 1 Guest are viewing this topic.
Offline Jacob Pickens
« Posted 2014-03-24 01:10:56 »

*Sorry for somewhat spamming the forum with my questions. I'm in one of those ideas aplenty moods.*

We all know those games. The games where you build a ship and then float it. Those games where you build a plane and then fly it. Those type of fun and creative games. How would you make one of those. I'm not asking for some advanced code just some theory that would enlighten me on the process. Yes, I have googled this. I didn't find anything useful, so as my usual last resort, I came here.

So, how do you make one of those games? I'm pretty sure the theory is plenty simple and I'm just not thinking straight, but still.

EDIT: I'm more focused on the movement of the individual parts of the said object. Such as the thruster moving the rest of the ships parts like walls and even people within the vessel.
Online Jimmt
« League of Dukes »

JGO Kernel


Medals: 128
Projects: 4
Exp: 3 years



« Reply #1 - Posted 2014-03-24 01:13:41 »

To be honest, you really are spamming the forum here, and not exactly with quality posts either. This question is pretty vague - build a plane and fly it? Physics engine that factors in the physics of something in the air. What are you asking for?
Offline Jacob Pickens
« Reply #2 - Posted 2014-03-24 01:16:16 »

Basically the movement of each individual part. Say you added a thruster to a rocket ship, how would I simulate that thruster moving every individual part of the space ship such as a cargo hold and a loading bay.

I'm sorry for spamming. I've been pondering these questions all day and never got around to posting them to the forum. Now that I have the chance, I'm just letting them flow out.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kingroka123

JGO Knight


Medals: 29
Projects: 5
Exp: 1 year


Gamer's Helmet


« Reply #3 - Posted 2014-03-24 01:21:04 »

Do you mean like Space Engineers?

Offline Jacob Pickens
« Reply #4 - Posted 2014-03-24 01:22:26 »

EXACTLY!!! I've been watching a lot of gameplay of that game today and it has inspired me. Now, obviously a more 2D style of it would be more fitting. Kind of like that game on here called Airships. I'm pretty sure you've saw it somewhere on here.
Offline kingroka123

JGO Knight


Medals: 29
Projects: 5
Exp: 1 year


Gamer's Helmet


« Reply #5 - Posted 2014-03-24 01:28:00 »

For the ship building, I would make some kindof system that allows the user to build off of specific nodes or faces in a 2D array in the master class: "Craft". As for the thrust, I'm sure Box2D has a way to add force to an object.

[Disclaimer]
Never actually used Box2D!

Offline Jacob Pickens
« Reply #6 - Posted 2014-03-24 01:31:01 »

Thats genius! I would have a base block that you could create. And if you click on it, any other block you place would be added to an array. That array would be the ship. Then, when you hit the arrow keys to move the ship it would cycle through the array and move each individual part of the ship. IDK if this is what you had in mind but your post helped a bunch. Tongue
Offline kingroka123

JGO Knight


Medals: 29
Projects: 5
Exp: 1 year


Gamer's Helmet


« Reply #7 - Posted 2014-03-24 01:32:41 »

Yep pretty much  Wink

Offline saucymeatman
« Reply #8 - Posted 2014-03-24 02:27:44 »

Yo, Jacob.
Why so many topics per day?

Not saying its a bad thing, its interesting to read them and their reactions.
Your almost at 7 posts a day haha (You can check in your profile)
Online Jimmt
« League of Dukes »

JGO Kernel


Medals: 128
Projects: 4
Exp: 3 years



« Reply #9 - Posted 2014-03-24 03:12:23 »

Thats genius! I would have a base block that you could create. And if you click on it, any other block you place would be added to an array. That array would be the ship. Then, when you hit the arrow keys to move the ship it would cycle through the array and move each individual part of the ship. IDK if this is what you had in mind but your post helped a bunch. Tongue
If you are using any physics library, this shouldn't be necessary - each block is connected, so moving one moves the others.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jacob Pickens
« Reply #10 - Posted 2014-03-24 03:22:09 »

Yo, Jacob.
Why so many topics per day?

Not saying its a bad thing, its interesting to read them and their reactions.
Your almost at 7 posts a day haha (You can check in your profile)

I really like the community and the forum in general. I feel like I might be slightly abusing it's powers though. Tongue

Quote
If you are using any physics library, this shouldn't be necessary - each block is connected, so moving one moves the others.

I've never really used a physics engine before. Never really had any use for them. What would best fit this type of game? I've already heard of Box2D are there any others?
Online Jimmt
« League of Dukes »

JGO Kernel


Medals: 128
Projects: 4
Exp: 3 years



« Reply #11 - Posted 2014-03-24 03:24:57 »

Box2D is perfect for modular building systems like this, if it's 3d then you can use jbullet or something. Something like space engineers or kerbal space program would be nearly impossible without a physics engine.
Offline Jacob Pickens
« Reply #12 - Posted 2014-03-24 03:43:12 »

Watching a few beginner things on Box2D, Why did I ever think I didnt need any of this!? Honestly, any programmer can just roll along basking in the greatness of libraries and not have to do a tiny bit of work. I've been overworking myself for absolutely no reason. I feel pretty dumb right now. Tongue
Offline LiquidNitrogen
« Reply #13 - Posted 2014-03-24 05:14:02 »

you have a base object, which contains all the other 'parts' objects in an array.

the base object has x,y position in the world.
the parts have x,y position relative to the center of their base object.

when you want to draw a part, or work out where a particular part is in the world, you simply add the position of the base to the position of the part, this gives you the parts true location..

now when you want to move the whole ship all you have to do is adjust the position of the base object.
Offline matheus23

JGO Kernel


Medals: 106
Projects: 3


You think about my Avatar right now!


« Reply #14 - Posted 2014-03-26 15:24:38 »

This article is really interesting:
http://gamedevelopment.tutsplus.com/tutorials/using-torque-and-thrusters-to-move-and-rotate-a-player-designed-spaceship--gamedev-2610

Smiley

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Andre Lopes
« Reply #15 - Posted 2014-03-27 03:35:41 »

Well. I guess my question is appropriate for this topic  *NOT TRYING TO HIJACK*

But what can be done about Thrusters ? I mean rendering... its possible to use particles and increase the particle effect as the speed goes up?

Offline Jacob Pickens
« Reply #16 - Posted 2014-03-27 03:39:38 »

ya that'd be quite easy.
Offline Andre Lopes
« Reply #17 - Posted 2014-03-28 12:50:42 »

ya that'd be quite easy.

How so
Offline kingroka123

JGO Knight


Medals: 29
Projects: 5
Exp: 1 year


Gamer's Helmet


« Reply #18 - Posted 2014-03-28 12:55:21 »

If the particles coordinate are relative to the world coordinates (not the ships) and the emission force is mapped to the rotation of the ship, you shouldn't have to increase anything with the particles because the trail will get bigger as the ship moves faster and should make a nice trail behind it.

Offline bilznatch

Senior Member


Medals: 8
Projects: 2
Exp: 1 year


I'm bad, I'm bad, I'm really... really bad T_T


« Reply #19 - Posted 2014-03-28 12:58:49 »

If the particles coordinate are relative to the world coordinates (not the ships) and the emission force is mapped to the rotation of the ship, you shouldn't have to increase anything with the particles because the trail will get bigger as the ship moves faster and should make a nice trail behind it.

But in the event you wanted a more consistent trail, you could just increase the rate at which you create particles dependent on the speed of the ship. But yeah, generally speaking, the particles would just make a nice trail regardless. (assuming you give them some sort of time to live in frames and they stay in a spot/travel opposite the ship, in which case they will indeed just make a nice trail behind you that gets thinner the faster you go)

Of course, if you wanted to simulate power rather than speed, increasing the rate of particles is the way to go, and this would of course increases speed as well, and if you turned the thrusters down, they would have less exhaust. This is probably what you're going for.
Offline Grunnt

JGO Wizard


Medals: 66
Projects: 8
Exp: 5 years


Complex != complicated


« Reply #20 - Posted 2014-03-28 13:10:40 »

I made a prototype recently of a moon lander type game using LibGDX and Box2D in which I could attach parts (e.g. core, thrusters, fuel tank, structural parts) to each other and then attempt to safely land on a randomly generated landscape and get back to a mothership.

The code is slighly messy and not very well documented, but maybe it may be of some inspiration to you. I think it will compile in its current state.

And when run it should give a pre-made lander which you can control and fly around (until fuel runs out and you crash). Thats pretty much it, no editing (currently parts are attached using code), no mothership or anything else. But it does show that making a ship-building type game using Box2D is quite doable. I may continue with it at some point, or some variant of it.

Here's the code, do with it whatever you like at your own risk:
https://bitbucket.org/BasvS/lander/overview

The thruster particles in this prototype are (if I remember correctly) propelled out at a speed independent from the ship's movement speed, but I'm not 100% sure of that. Took some experimenting to get right, and it still looks a bit weird if the lander goes at very high speed.

Edit: some highlights:
- it combines the Artemis entity system with LibGDX and Box2D (a nice combination of frameworks imho)
- The entity factory that creates parts using Box2D and attaches them to each other
- Simple particle system
- Here is how thrust is applied to a part using Box2D applyForce
- Part configuration file which is editable using the part editor

Pages: [1]
  ignore  |  Print  
 
 

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (11 views)
2014-08-28 18:26:30

CopyableCougar4 (24 views)
2014-08-22 19:31:30

atombrot (37 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (29 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (27 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (33 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!