Multithreading question

Post all other topics which do not belong to any other category.
Post Reply
jordan30001
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Jul 16, 2014 2:57 am
Contact:

Multithreading question

Post by jordan30001 »

I know that the ticks/rendering and loading of sprites is all multithreaded but are the chunks (or area of chunks) multithreaded?

Rahjital
Filter Inserter
Filter Inserter
Posts: 435
Joined: Thu May 29, 2014 10:44 am
Contact:

Re: Multithreading question

Post by Rahjital »

If you mean terrain generation, yes, it is.

User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: Multithreading question

Post by SHiRKiT »

Factorio is pretty darn well efficient in my opnion for an indie game.

Rahjital
Filter Inserter
Filter Inserter
Posts: 435
Joined: Thu May 29, 2014 10:44 am
Contact:

Re: Multithreading question

Post by Rahjital »

Well, parallelised map generation was only added in 0.10.0, but you've got a point. Factorio dev team has been doing a wonderful job making the game nice for their players.

Drexir
Burner Inserter
Burner Inserter
Posts: 19
Joined: Tue Apr 29, 2014 5:04 pm
Contact:

Re: Multithreading question

Post by Drexir »

SHiRKiT wrote:Factorio is pretty darn well efficient in my opnion for an indie game.
I would agree. The devs on the team are very smart. It's also the added benefit of not using an existing engine. Well Allegro, what they use, is really more of game programming library. Kind of like SDL but with a bit more game programming features. Not only that but it's written in C by people who actually know how to use C properly. So very lightweight. Unity for example is a fully fledged game engine which is usually written with C#. Or you can use UnityScript to write in python or javascript. Ultimately it comes down to being able to quickly prototype and develop games. I think just now with unity 4 or 4.5 they finally support 64bit and don't believe it supports multithreading either still. This has it's upsides a new game programmer can get his feet wet and indie developers can quickly make games. This has it's downsides though. A lot of bloat. Not to mention it took them a long time to support 64bit and it's still not stable. Even the editor and some of the tools are 32bit. Which may have changed with v4.5. Yea the devs of Factorio really work hard to optimize even the small things. You don't see that much any more.

The biggest downside with unity is if theirs a bug which their are many especially in big programs like that. As a game developer their's not much you can do about it except hope and wait for them to fix it.

If you take a look at a game called Kerbal Space Program. The game definitely suffers a lot from the limitations of the unity engine. In fact the terrain generator part of the engine was so bad that they had to write their own. Rust had to do the same which is probably why you see all the rage in that community. Because they simply had to drop the development and start from scratch. Is that the developer's fault? Well I truly believe the developer just wanted to see if their was any interest in his project. Unfortunately the model they choose was poor at best. The whole releasing it on steam early access at $20. Meh you don't sell a prototype. You do a kickstarter, indiegogo, or whatever and provide a working prototype. If you have a prototype but realize that it would only be a detriment then that's fine. Not all genres of games work well with alphas much less prototypes. I think Star Citizen did an amazing job with how they approached it. Didn't have any decent prototype for the public to enjoy. But provided trailers, their ideas of the project, what they want to achieve with the fundraising. For the people who funded the project on kickstarter they were of course offering the full game, providing alphas, and more. It was $30 for that. Maybe a tad pricey? However in that case you're not giving $30 to buy a game but $30 to fund a project that may or may not ever see the light of day.

The alpha is still a ways off but they still released prototypes in the meantime. When it was ready. It was all brilliantly executed and which is probably why it's the biggest crowd-funded game ever.

Releasing a prototype on steam for $20 and saying this is the game we are making that's in a "alpha" state. Steam early access was just a bad route for them to take. People don't go on steam to purchase prototypes they go their to buy entertainment. A prototype is obviously not going to be enjoyable. So buyer confusion at best. Not to mention the other 100s of early access games and there's a few who of them doing it for a quick money grab. Learn a little bit about programming. Fire up unity or some other engine and within a couple months throw it on early access with either no intentions of actually finishing the project. Or the person behind the project probably has never actually made a game. Has no clue about the process of game development. They may have good intentions "Like oh I can create a game people will enjoy. I just need a little help financially".

Don't get me wrong I love the idea of "artists" able to easily get their work out there. Not just in the games industry but all arts of creation to music, books, etc. There's not an easy solution but simply to educate buyers. Any other solution would just hurt the legitimate creators / artists alike. The only thing I can think of is if you decide to sell a game your responsible if that game never meets the light of day. Another words if Valve for example stepped in and the developer was required to refund the money. I think at least with the developer actually being responsible for the money it would make them at least think twice about selling a "game". And it would fend off people out to make a quick cash grab. Do a kickstarter. Be transparent and honest. Hell just doing that I don't care if you've never made a game I may just help fund you. You share your ideas on the project. What you want to achieve. Why you want to achieve it. Share the progress you've made so far. Why do you need the funding? Are you really in need of funding; as in funding is the only way you could finish this project?. Maybe you were working in the industry and got laid off and McDonald's is obviously just not cutting even basic living expenses.

Our society is so hung up on the idea of if it's really loud, over confident, and looks good. Then it must be good! Anything less will simply be overlooked. I hate that mentality. It turns people into having a mindset of "fake it until you make it". Never mind the deception and harm it can cause to the ones around you. You're deceiving your self.

Honesty, humble, intelligent, decent character, and comfortable with who are; you don't feel the need to pretend to be something else. Those are the characteristics that I prize in a human being. While most will claim that's what they value. Most that make that claim don't even hold it as truth. More disturbingly as I've found some people look down upon those qualities. I've never understood that. Maybe they somehow perceive it as a threat. If I find those qualities in someone and it doesn't have to be all or nothing. I will be intrigued to say the least. I would be delighted to have the opportunity to meet someone like that. Even more so the opportunity to learn from them.

But yea I somehow turned this into a really long post and also managed to get way off-topic at the same time. I'm debating just deleting it considering it's not appropriate. But after spending that time making a wall of text... lol.. Makes me hesitant to just delete it.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Multithreading question

Post by ssilk »

Hehe, you need to be somehow frustrated to write more than 1 screen about game development with unity. :) ;)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Drexir
Burner Inserter
Burner Inserter
Posts: 19
Joined: Tue Apr 29, 2014 5:04 pm
Contact:

Re: Multithreading question

Post by Drexir »

ssilk wrote:Hehe, you need to be somehow frustrated to write more than 1 screen about game development with unity. :) ;)
Well maybe not frustrated. Okay slightly frustrated with the idea that any one can program complex pieces of software. They are capable because in recent years it has become more accessible but just because they are capable does not mean they are capable of writing good code. It's really more of an "opinion" that only I seem to have. You don't learn to write good code or much less learn a programming language in 24 days or 24 hours or 7 days or whatever a lot of books publish in their titles with "learn X in Y time". Or claim or celebrate the fact they're book can teach you really fast. No book, no article, no teacher or class is going to teach you how to write code. They will show you the syntax and semantics of the language. And maybe you will memorize them if your to be tested on it. But you still don't know how to write code much less write good code.

Learning how to write code is simple and completely free. All you have to do is... Start writing code. Sure grab a book on the language your using so you can reference it if you forget some of the syntax. Or heck I'm sure you will find free reference tutorials online easily. The first question you will ask your self what do I want to write? Maybe your tired of solving quadratic equations. I'm just using that because when I started I wanted a calculator that did that for me. Then you say okay how do I want the program to look or be presented and what features do I want it to have? Basic text console input and output is good enough for me, etc, etc. Just a small bit of planning / thinking. Then the hardest part something that can never be taught. Translating your ideas / thoughts into code so it is comprehensible to the computer. This is the key how to think like a computer. It's gonna be very hard. You will fail and fail to translate it properly. Not every one is capable of becoming essentially a translator. Especially a translator for something as dumb as a computer. Even if you are that type of person that is capable it is a skill that is going to have to be developed. Not in 24 hours or 7 days or 24 days or 48 months. You don't say I'm going to learn how to play the piano in X time. No you just start playing and playing. The more you play the better you will get at it. If you want to measure anything record your first session and compare that to your latest session. Does it sound better than the first session? If so good your making progress. Translating your ideas / thoughts into code like I said your going to fail and fail until you finally have a running program. Those failures are gonna teach you way more than any book ever could. You just do this again and again. I hope playing the piano doesn't bore you. Even the best piano players arn't going to sit down and make new beautiful music every time. The same goes for writing code. You're not going to make the most amazing software every time you code. So I hope coding doesn't bore you. If your idea of fun is a completed piece of work then programming is not for you nor playing the piano. If I gave you a puzzle that was completed. That would be no fun. I'm terrible at this I guess the TLDR is it's not the destination it's the journey.

Lately I've seen this in the programming world. I don't need to know how the computer works. I'll just learn to use this tool that disguises it and I will create great software. I'm not really even sure how this tool works but when I type X and Y I get Z. So I'm perfectly fine with being oblivious (maybe not the word I'm looking for; brain fart).

I've talked to many other programmers about this very subject and nearly every one of them disagrees with me. So we'll continue to "teach" people this way. And then when one day that person who was used to typing X and Y and getting Z every time. Then all of a sudden one day they don't get Z. I'm not really sure what they'll do on that day. Maybe their boss or whatever fires them in place of someone who knows what Z is. Or maybe they won't even know that X and Y didn't produce a Z. Next thing you know you just armed a nuclear warhead. Or just told a robot to kill. Maybe not that dramatic but as a side effect you created a security vunerability and someones bank account information was leaked or allowed someone to infiltrate the system to empty their account. Or infiltrate the entire database and sell all that personal information SS#'s, names, full addressees, credit card number, passwords, account #'s and sell it to the highest bidder. Okay I'm exaggerating a bit but you get the point. TLDR again reach a solid skill and experience in translating code. Then next step is to work your art to write good code. Six months later you'll look back and be amazed at how much you've learned and how much experience you've gained. And amazed at how terrible your code was on your first program. On the other hand you can go to a college and six months later think did I really learn anything? Well I've learned that it doesn't take long to be in college to go in debt at least. I've got straight A's so I must have learned something or I'm just really good at memorizing stuff for a test. At least here in the US you don't go to college to learn you go to college for prestige and recognition.

p.s. to be fair on my monitor it was only half the screen :P

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Multithreading question

Post by ssilk »

When new programmers come in my company (in my team) and start discussing with me, why frameworks are better than pure JavaScript or PHP or why they are using Doctrine for creating their queries onto a very simple database schema of only 5 tables, knowing, that speed is on the top prio of the customer, I take them into the room with the big whiteboard and two hours later the whiteboard is full with schematics how the request is handled with their method and how with mine. Their method needs 3 papers full and mine in most cases only a half. :)

...

Last Friday I brought my old C64 into the company, I wanted to repair it in my slack-time. The younger said: who needs this? My smartphone has an emulator to run any game the c64 ever had.
I said: "come on, sit and take the voltmeter and tell me what you see, if I make this command."
"It says zero. And now it 5 volt!"
"Ok, and now show me, how you can do something like that with your smartphone..."
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Multithreading question

Post by kovarex »

To answer the original question.

No, the game updates is ran in single thread. Moving the game simulation (apart the map generation) to individual threads divided by chunks is not so easy, especially when it needs to be deterministic, and we keep it in reserve when other optimisations will not be enough.

User avatar
Zourin
Fast Inserter
Fast Inserter
Posts: 246
Joined: Tue Feb 11, 2014 2:15 am
Contact:

Re: Multithreading question

Post by Zourin »

Drexir wrote: Releasing a prototype on steam for $20 and saying this is the game we are making that's in a "alpha" state.
#wayofftopic sorry

Yeah, that's the trap in the early access market right now. Games like The Forest, while presenting a wonderful prototype, aren't actually 'alpha' state, so much as 'prototype'. Early access runs a high risk of 'burning out' their paying customers early before building community support. What do you think happens when people say "Yeah, i bought it, but it's terrible right now and needs a lot of work." More often than not, nobody goes back to check up. The developer loses sales in the end because people don't espouse the games' greatness. "Wait and see" can quickly become "Wait, forget, and stop caring."

That's also where there's a very, very critical relationship between early access developers and the Let's Play youtube communities (a phenomenon that rocketed thanks to Minecraft). Where would the Kerbals be without Scott Manley? The Fun Pimps making 7 Days to Die just got a 2 parter from RoosterTeeth. Proffessional "Let's Players" are the best engines for sales nowadays. People are tired of being burned by blind buying, and looking to their favorite 'Players' when they pick up on that 'fun something new'.

Post Reply

Return to “General discussion”