Intertwining Engines (WIP game)

Intertwining Engines is a game I’ve been working on for about a week (although not that much “game” has been made yet). I’m gonna post some progress reports here is anyone is interested.

Game Idea:

Resource manager! Connect train tracks between different depots, factories, etc. Create an automated manufacturing system using trains.

Unsure about these parts:

  • Research/tech tree? Unlocks resources and more efficient mining equipment and faster trains. I’m not sure what conditions would be needed to unlock techs though. Maybe it could be a currency system.
  • Limited resources? Having deposits only have a certain amount of a resource in it could make the game harder, but it could also be annoying having to move everything after a while. I might make it so that depots can be restored somehow. Maybe with a tech.
  • Workers/population system? Having it so you have to transport workers to and from workplaces and housing might be interesting. Could eventually turn into a city builder though, and idk if I want that. I would probably be inclined to include food and water too.

Current Progress

I haven’t made much progress yet, unfortunately. The one thing I have been working on is creating the train track system. I want it to work by places points down and connected them together, and the game automatically creating the track between them. I’ve almost finished it, but It still needs angle limits and lots of issues. However, it works under some conditions which is promising.

Note that this is not how the actual game is gonna look like at all, I’m just making the system before designing sprites and whatnot.

This screenshot shows one of the many problems I have yet to fix. Sometimes the curve has the wrong angular displacement, other times it doesn’t even have the rights arclength.

After I finish the creation of the train tracks, I’ll probably try getting some trains to follow the track correctly. I already have quite a few ideas how to do this. Once I get those two things working, I’ll add in some sprites to make it look nice.
Unfortunately since I have a lot of school stuff progress is very slow and it’ll be a while before I have anything playable.

If you have any thoughts, suggestions or ideas I’d love to hear :slight_smile:

5 Likes

Reminds me of Mini Motorways or Mini Metro.

If you can’t get the curved tracks to work you can always use a grid-based system like in those games

3 Likes

Try Hot Wheels track builder for reference?

Among

Also I will probably make a Ressha Sentai ToQger mod for this game of yours when it comes out

Progress Update:
I have gotten the connections to work! Finally, after 2-3 weeks of work, I have smooth lines.

Here is the link if you want to try it out.
Just click and drag from one red node to another.
You can zoom in and out with I(n) and O(ut). Click and drag anywhere but the nodes to pan the camera. Press R to reset.
The junctions start with a random rotation every time.


Now that I have finished the smooth connections, I’ll probably work on having rotations for each track piece, adding limits to the turn angles, adding a preview when you hover over a connection, and all together make creating train connections more polished.

6 Likes

This looks great! Only thing I have a gripe about is the title of the game - “Intertwining” is pretty lengthy and I don’t think it is clear enough to tell the player what it’s about.

Some thoughts of titles (just spitballing):
Railroad Tracker
Tracker
Imagine Engines
Steam Tracker
Path Forger
Wayward Engines

Anyways, fantastic work!

4 Likes

more name ideas ideas I got, partially inspired by rcreger, the game’s original title, JoJo’s Bizarre Adventure, Hot Wheels, and Ressha Sentai ToQger. My best ideas (in my opinion) are in bold.
Star-Crossed Engines
Furious Railroad Engines Go!
Train Tracker
Steam Forgery Master
Flowlab Track Builder

2 Likes

Well I guess if we’re giving suggestions I’ll give some (btw I’m fine with the original name)

Ravel Engine
Station Relation
Train Hive

idk if you like those ideas or would like to keep the original

3 Likes

Yeah I like the original too but I wanted to share my fun ideas because they’re fun

2 Likes

Thanks for all the name suggestions! I think I’ll probably change the name later on when I have the gameplay and possible storyline.
Here is a quick update on my progress:

I have spent hours solving ridiculously long algebraic equations to find a way to get two circles to always touch. Here is a link to a Desmos graph showing it off: Movable Circles
Now there is no straight line connecting the two nodes, it’s all curves. At the moment it looks like it’ll make turns super wide and smooth, but I’m fairly certain that once I implement the angle / distance limits it’ll look much better.


smoooooth… I’m sure you can see the difference between this and the previous update, there are no parts of the path that are just straight while the other parts are curved; it’s as smooth as possible (possible meaning the limits of my patience).

Unfortunately I think the biggest issue right now is the gaps in the two halves of paths.

image

Not all of the paths have this gap, this inconsistency means I can’t apply a simple extension to the number of paths added. I’ll need to test out a bunch of different situations and find trends and patterns in the cause, then find some formula for adding in an extra path.

image

While issues like this are small, they take a lot of time and it’s gonna slow me down a lot. I really want to fix every issue now so I can have a solid base to work with when I move onto other parts of the game.

To close off this update here is a poll:

Which designa for trains sounds best?
  • Each train engine can only carry cars of a specific purpose. Ex: a resource train that can only take containers. Passenger train that only transports workers.
  • Trains can have any combination of cars.
  • Multiple engines connected make a train go faster
  • One engine per train
  • Engines are more personal, getting a new engine takes a lot of work. Engines can be customized in more ways / upgraded.
  • Engines are more disposable / easier to get. There is little limit to how many you have, the real challenge is managing them to not crash and get to where you need them.

0 voters

3 Likes

While I’m here; does anyone want to get pinged when updates come out?

Get pinged?
  • Yes, ping me
  • No, don’t ping me

0 voters

3 Likes

This seems like a super cool project that I’m really exited to see finished

1 Like

If you need any concept art I’ll be happy to make some, I want to improve my art skills anyways, so why not save 2 birds with 1 stone?

1 Like

I’d really appreciate that, actually. I haven’t had much time to work on figuring out what the art will look like yet so I’d love to see what you have in mind.

1 Like

I wasn’t sure what to go for so I just picked a minimalist palette and worked with that


I made 2 designs for the train station (The top left one was working off of the original dimensions)
For the second design, I used a 32x32 size so I could have more room to work with. I also used a better palette for that one. (Btw, the red and green side is for when a train is in the station or when it is empty. If you wanted that could be its normal sprite though)

For the tracks, I made 3 different designs.
The first looks similar to normal train tracks, but because it’s not all connected it could look strange.
The second accounted for the tracks not being connected and was mostly focused on being something that would be easily seen.
The third design was 4x4 because that is the current size of the track in the game


This is a rough draft, so if you want to change something I’ll work on it.

Some things you might want:

  1. An outline (Colored or not)
  2. A different color palette
  3. More detailed sprites
  4. A different art style
  5. Whatever else you can think of

Also, I’m not entirely sure of everything that you want to be in the game, so if you happened to have some sort of list that would be great (Details of mechanics would also help)

3 Likes

Update Time
So I’ve been pretty busy with school, as well as… lack of motivation let’s call it.
Since the last update, I has tried making the angles of the connector pieces constant but that’s when I realized – the current formula I was using wasn’t gonna work. I was calculating the intersection of two lines using the y=m(x-h)+k formula. The problem with it is that you eventually end up dividing by zero if one of the lines is vertical. I knew there was a solution because I could visually see what the answer would be based on the geometry, but I couldn’t find the answer mathematically.
I investigated a lot of different ways to draw circles with a combination of known points and tangents. However, my brain couldn’t handle doing so much algebra in addition to my classes. I couldn’t find a proof + solution that I could comprehend. I spent about a week and a half on this btw so I was dying to make any progress.
Only recently did I come across the “standard form” of a line: ax+by+d=0. I don’t know how I completely forgot about this formula, but I haven’t worked with it in algebra at all. I also figured out a good solution for the parameters I needed to fill.


I used this principle: for a circle to lie on a point and have a tangent, the center of the circle must on a line 90deg to the tangent that intersects the point. Picture above uses red for the tangent. The purple circle is always tangent to the red and touches the tangent at a specific point. All possible variations of circles that fit these parameters have their center on the green line.

image

Now that I have a way to see the possible solutions for one tangent, I can compare two point-tangents. The circle that fits the parameters of both point-tangents must lie on both green lines, therefor the intersection of the lines is where the center of the arc will be.

image
(Circles not drawn exactly proportional, they have the same radius)
In my game I already can find point 1 and it’s tangent, as well as point 2 and its tangent. From this I can find R (a whole other process, but we can skip over it). Given R we can find Center 1 and Center 2. Then we can find the Midpoint, which I do with cos() and sin(). The angle of the midpoint tangent is a negative inverse to the line between the two centers.

After all of this, I was able to find a formula to calculate the intersection of the lines using ax+by+d=0. Now that I understand it all better and made a new equation, I had to rewrite the whole connection function. However, the code is a lot cleaner and it works when the connector pieces are completely vertical.

I explain all of this because from the outside it looks exactly the same as two weeks ago lol. Now that I’m out of this rut I can finally work on new things!

Pings

@CodeAlpaca @rcreger @MrGoose @Pixel_Name1

4 Likes

It’s funny because I was imagining a totally different scale! The idea didn’t even come across to me to make everything tiny. I originally wanted to make full sized sprites and use sprite stacking to make the trains look nice. But I’ll probably have to think about performance and practicality as well.
As for the art theme I was thinking of a more natural / realistic theme. Idk why but I keep thinking about trains in the “wild west,” with plateaued mountains, red rocks, and gold mines. I think I also want to include some grasslands with some nice looking grass being blown in the breeze. I’m thinking you start out in an empty world with beautiful nature, but as time goes on maybe you maintain a balance between progress and preserving nature. Having a contrast between the start with vibrant colors and an endgame where pollution is rampant and everything is dull could be very cool.
I think having a top-down perspective would be a lot easier to make, letting me focus on other aspects, but I am also very excited to do sprite stacking from a slightly angled perspective. Feel free to respond with any thoughts you have!

2 Likes

This is incredibly useful, I’ll get working on something today

1 Like


So would something like this be better? (Ignore the coloring)
I could change the bottom so you don’t see the building, instead, you would see the train parked underneath.

Idk if this is more what you’re looking for or if you want the view to be directly straight above so you don’t see the front of the building.

btw it’s 98x64

3 Likes

Mini update
I haven’t worked as long or hard on this as I have the previous updates so It’s a mini update :). So what have I been doing? Well it turns out there are even more issues with the track building! When you need to create a track that is perfectly straight you can’t use curves because… well curves are curvy. To make them straight you need a radius of infinity, which computers can’t interpret. So I ended up having to do an if else statement essentially, and draw a straight line when necessary.
Another issue was that sometimes there was a hole in between the two arcs (see on one of the previous updates). I went ahead and decided to fix it because I need consistency! after some testing I realized that each arc was spawning one extra track then necessary, so once I shortened it I could get a consistent hole in each connection. That is a lot easier to fix, because if it happens every time then you can just spawn an extra one in the hole, no conditional statement necessary. I also got the ends of the connection (on the nodes) cleaned up, so now the entire connection looks very neat.
There is one last problem with the connections. When two nodes that are exactly opposite angles on opposite sides are connected, they can’t form any arcs that actually connect. This is because it’s simply mathematically impossible; see picture below.

This is fine though, because you would never actually need to do this. Since the connector pieces in game have a node on each side, you could just use those to make a connection instead:

So now that I finally have some polished connections, I FINALLY get started on the track editor. I want to create a full UI that allows tracks to be edited, rotated, deleted, ect. Look forward to the next update, I expect to have a lot more actual stuff added in then.

Almost forgot to mention, but I tried adding in a simple sprite to see how it looks:

If you have any suggestions feel free! I’m still undecided on how exactly I want the game to look, as well as how I want the editor to play out.

2 Likes

This is way better than anything I could possibly do lol

2 Likes