[ / / / / / / / / / / / / / ] [ dir / random / 93 / biohzrd / hkacade / hkpnd / tct / utd / uy / yebalnia ]

/agdg/ - Amateur Game Development General

AGDG - The Board
Name
Email
Subject
REC
STOP
Comment *
File
Password (Randomized for file and post deletion; you may also set your own.)
Archive
* = required field[▶Show post options & limits]
Confused? See the FAQ.
Embed
(replaces files and can be used instead)
Oekaki
Show oekaki applet
(replaces files and can be used instead)
Options
dicesidesmodifier

Allowed file types:jpg, jpeg, gif, png, webp,webm, mp4, mov, swf, pdf
Max filesize is16 MB.
Max image dimensions are15000 x15000.
You may upload5 per post.


Welcome to AGDG, keep working on your game anon!
See also: /ideaguy/ | /vm/

File: 48f56f34bcd1769⋯.png (201.81 KB,359x277,359:277,BreakOut_arcadeflyer.png)

59856c No.31391

I was working on a city sim, but it's just too complex.

I like making my games from the ground up, making all the libraries etc. I have made a networked, multiplayer pong previously.

What's next? I remember reading someone saying making pong first, then make breakout, then make pacman etc. Is there an order I should be making games to get to the point of being able to make a sim city clone?

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

76de51 No.31400

You don't need to trip, the board has poster IDs. You don't need to be making games in any specific order. The point is that you should be learning general techniques that help you make advanced games. What part did you get stuck on when you were making your city sim?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

5e6fe7 No.31405

I'm tripping because I could be posting from my work PC over TOR, my personal laptop, or from my phone. Just trying to prevent confusion, ordinarily I'm not a tripfag.

I get it that there isn't a specific order, I guess I should have asked, "what's the next game I should tackle?"

For the City Sim, what I have now is:

- Graphics drawing sorted

- City rendering on a tile-by-tile basis. I.e. I'd need to lookup whether to draw a road here or a building etc, but that's just implementation detail

That's about it.

Right now; I was planning on:

- Having a sort of "buckets" system, where a tile has so much water, so much labor, so much x, so much y. Basically, every tile is either producing something, consuming something, or most likely doing both.

- Each bucket encompasses buckets beneath or may be in its own layer.

- What I'd hope to do is a make a complete agent-simulation; but only where appropriate (like, poo isn't an agent, it's just a rate). Sort of mix the best of Sim City 4000 and the new one that fucked it all up.

What I've attempted to do is create the road network. But this is where I'm stuck. I have a "City" class and an associate "CityRenderer" class. I imagine the city needs to have a "Road Network". But how do I do this?

At first, I started on making a graph. Intersections that have connections to other Intersections of varying lengths. Two intersections could have multiple paths to each other. Great, so how do I define these paths? Well, not it's tile-based and not so much a graph anymore.

Should I do both? The graph with lengths to make path-finding easier (like increasing lengths based on the traffic in real-time?); then the tiles define the actual drawing path?

How do I add a new intersection? How would I draw an agent on the road (with a distance along the current connection between two intersections?), does the "agent" hold this, or the network hold this? Or does the agent spawn a network-agent?

Sorry for the rambling. I guess the problem is the architecture of the code and systems moreso than the gameplay I want to implement.

I accept that the best way to approach this is to build smaller games and build bigger and bigger over time until I get to the point that I can recognise the correct architecture without much thought.

So with that in mind, considering I made a networked multiplayer pong (with no single-player). What's the next game? Breakout? Pacman? Super-mario style?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

36c220 No.31408

>>31405

>At first, I started on making a graph. Intersections that have connections to other Intersections of varying lengths. Two intersections could have multiple paths to each other. Great, so how do I define these paths? Well, not it's tile-based and not so much a graph anymore.

Vertices + Edges = Graph

Every road end or intersection is a vertex. Every length of straight road is an edge. How has this stopped being a graph subject to things like Dijkstra's algorithm and minimum spanning trees?

>Should I do both?

Is there any reason not to?

>How do I add a new intersection?

Add a new vertex and edge.

>How would I draw an agent on the road (with a distance along the current connection between two intersections?), does the "agent" hold this, or the network hold this? Or does the agent spawn a network-agent?

Now you're throwing in the word "network". Did you make this city sim online?

Your language stinks of academia in that it uses a load of unnecessarily fancy, esoteric vocab words that are neither defined in your body of text, nor common enough to google. When you confuse a peer reviewer in papers you get a chance of being accepted out of hand under the pressure of the reviewer not wanting to admit they don't know what you're talking about. On the internet, however, I'm just going to recommend you write coherently.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

263479 No.31410

> Now you're throwing in the word "network". Did you make this city sim online?

I meant the Road Network that I mentioned. Like, should the Agent describe where it is, or should the Road Network describe where the agent is?

> Your language stinks of academia in that it uses a load of unnecessarily fancy, esoteric vocab words that are neither defined in your body of text, nor common enough to google. When you confuse a peer reviewer in papers you get a chance of being accepted out of hand under the pressure of the reviewer not wanting to admit they don't know what you're talking about. On the internet, however, I'm just going to recommend you write coherently.

Cool.

The problem I'm having with the idea of a road network is how do I translate the tile-based placing of roads into a tree graph? How do I incorporate agent-based traffic if it's a network; considering roads will have different "lanes" for traffic that will matter in a agent-based approach (think if everything wants to turn left, that needs to develop backed-up traffic).

Again; it's the architecture I'm struggling with. When to use a tree-graph, where to hold X piece of data, should I translate between tile-based stuff and other structures.

How does one work through those questions? Should I answer all of that before I start writing code?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

263479 No.31411

can't even trip

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

36c220 No.31414

>>31410

>multiple lanes

Multiple edges

>everyone wants to turn left

Multiple vertices in a single point

>backed up traffic

Factor in a "traffic pentaly" when pathfinding.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

eabd6e No.31415

>>31414

How would I handle lane changes of agents though? Wouldn't that mean that I'd need vertices of the tree everywhere?

So like if a single lane in one direction on a tile can hold 4 cars, would that single lane require 4 vertices?

If so, how would I even handle path finding through it?

Apologies if I'm sounding amateur. I am.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

36c220 No.31417

>>31415

So an agent sits on an edge a specific distance from origin vertex to destination vertex(let's just call this a position). To hop lanes, you'll need to know which lanes are adjacent to which. This might be a good time for some OOP with a Lane class that has two neighbors that can either be null or references to other Lanes.

You'll probably want a function that tells you if a given position on a lane is free, then give agents access to that.

As for path finding, just do what you were going to do before(either Dijkstra's algorithm or something fancier), but when comparing the different edges, just add the number of cars on to the distance.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

1bf125 No.31421

File: 6273ed8c06cbc37⋯.png (203.11 KB,2256x1039,2256:1039,ClipboardImage.png)

This is what I've come up with.

Vehicle has a path to take which is a series of Intersections

-At each intersection it will look for a LaneConnection that connects it's lane to a lane that connects to the next Intersection it wants

-If it can't find one (it means the graph has changed), so recalculate the path

-The path finder should maybe have a priority queue to process stuck cars first so that they're not blocking traffic

-Needs to check if this intersection has lights

-If it does have lights, will only proceed on a green light to enter LaneConnection

-Needs to check if any of the blocking lanes have a vehicle in them. If it does, then it is blocked and will not be able to move forward into this LaneConnection

Intersections:

-Process Lanes in a round-robin way so that every lane gets a chance to inject a car into the LaneConnections

-Each lane is checked to see if there's a Vehicle there, and it's logic is processed.

-Then every other vehicle in that lane is processed

Vehicles travel down roads by measuring the delta distance between it and the car in front / end of lane.

-If the distance is getting larger, we can speed up at acceleration rate until no more than speedLimit or drivers speed limit

-If the distance is getting smaller AND the distance is less than the breaking threshold for this driver, we will calculate brake rate to match drivers speed before hitting them or 0 for end of lane

-d = distance between vehicle and leading vehicle / end of lane

-s1 = vehicle speed

-s2 = leading vehicle speed or end of lane (0 speed)

-sd = s1^2 - s2^2

-dr = sd / (2 * d)

-dr is the deacceleration rate to apply

-Vehicles should be processed from front of lane to back of lane

Vehicles will change lanes when:

-The current lane has reached a threshold of speed. I.e. some drivers will change if it's 10% slower than speed limit, others will if it's 50% lower than speed limit

-Check the lanes to the left and/or right and ensure they exist

-For the lanes found, check to see if they also connect to a LaneConnection at the next Intersection, that leads to a Lane that connects to the next Intersection in the path queue. I.e., they won't change lanes if that lane won't get them where they want. This means there's no one who will be overtaking or anything like that.

Lane Connections are setup to:

-Have the left-most lane or two leftmost lanes to be turning lanes etc

-Vehicles should naturally move into available space

Some drivers:

-Are slower or faster than others

-Will brake earlier or later than others

-Will change lanes more readily than others

-This should hopefully allow the roads to look natural as cars are travelling through them.

What do you think, Anon?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

000df3 No.31448

>>31421

I'll give a response some time soon, but don,t have the time to invest in a decent reply right now.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

56f9bf No.31449

>>31448

Whenever man, I'm not going anywhere. I appreciate the time you've already given me.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

000df3 No.31474

>>31421

In all honesty, we've approached the limit of complexity that a AAA studio's money-handlers are going to approve of funding. If you implement what you've got right now as a 3D simulation (using only x and y coords for movement), you'll have something special that non-technical people can admire. If you can find any nice assets to put over said simulation, all the better.

If you want to make it far more complex, however, here are some more considerations.

Does a car's position from point A to point B factor into lane switching? (ie, can two cars be side by side, restricting lane switching?) If so, can cars collide by switching lanes into occupied positions?

If a car brakes faster than the one behind it, is there a collision?

If there is a collision, how does this effect path finding? (ie will cars all get in another lane to avoid the lane with the collision?)

You describe the lane-switching logic as if the people will always make good decisions. Is there some percentage chance a person will make a bad choice?

What of stop signs and lights?

This could keep going, unfortunately.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

c1ed19 No.31564

>>31421

This is too complicated to start out with. There's a reason why the early Sim City games didn't have this kind of thing. Make a graph of interconnected intersections. Each path has a capacity of X cars based on various factors. Cars will try to path along the intersections to their destination. Each tick, cars will offload from one path to another in FIFO order. Then you can work on the other parts of the game.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



[Return][Go to top][Catalog][Nerve Center][Random][Post a Reply]
Delete Post [ ]
[]
[ / / / / / / / / / / / / / ] [ dir / random / 93 / biohzrd / hkacade / hkpnd / tct / utd / uy / yebalnia ]