Author Topic: Thank You Arcen!  (Read 3462 times)

Offline Echo35

  • Master Member Mark II
  • *****
  • Posts: 1,703
  • More turrets! MORE TURRETS!
Re: Thank You Arcen!
« Reply #15 on: June 06, 2011, 03:16:13 pm »
On the server computer it should be hitting two cores fairly hard; one for the main thread and one for the AI thread.  We can't control processor affinity from within the application, but I think you can do that from Process Explorer (or Task Manager, if you use the builtin).

The memory has to fit within the 32-bit addressing space, and most of the game-logic has to fit within the roughly 800MB mono heap (thankfully textures are not counted against that).  Loading more stuff into memory would quickly result in large games being unplayable due to frequent out-of-memory crashes (we know, we really hit that wall towards the end of last year, and thankfully were able to ratchet some things back).  But calculations are not happening on disk, don't worry about that.

This. The game is threaded (More so than any AAA titles out there) and runs exceptionally well for a 32 bit application. If you have a processor with multiple cores, it will offload the extra work onto the extra cores, just as it will with any game. If you have a system on that level and are experiencing lag, it's more than likely your network.

For the record, I loaded up my game of AI War (Which I just started granted, so there's not a lot going on in terms of ships and things being loaded in the game) and my CPU is sitting at about 4% overall, with each physical core having some level of load on it (Core i7 2820QM for reference).

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Thank You Arcen!
« Reply #16 on: June 06, 2011, 03:20:50 pm »
If you have a processor with multiple cores, it will offload the extra work onto the extra cores, just as it will with any game.
Well, actually the game can only use 2 cores to any great efficiency, and only 1 if you're a multiplayer client (rather than the host, which has a separate thread for the AI).  There are a few other threads for audio and whatnot but they generally have trivial load.

That said, generally if you're running a multiplayer game as a host you want at least 3 cores, 1 for the main thread, 1 for the AI thread, and 1 for everything else on your system.  With just 2 cores you'd have conflicts with the OS, etc.

Quote
If you have a system on that level and are experiencing lag, it's more than likely your network.
Either that or you're running on a high speed or have a really active gamestate.  The Insane profile will bring most systems to their knees, that's kind of the point.  The 50ms speed is the normal one, and the others are there to help people get through really-high-ship-count situations in a reasonable amount of real-time.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Echo35

  • Master Member Mark II
  • *****
  • Posts: 1,703
  • More turrets! MORE TURRETS!
Re: Thank You Arcen!
« Reply #17 on: June 06, 2011, 03:30:27 pm »
If you have a processor with multiple cores, it will offload the extra work onto the extra cores, just as it will with any game.
Well, actually the game can only use 2 cores to any great efficiency, and only 1 if you're a multiplayer client (rather than the host, which has a separate thread for the AI).  There are a few other threads for audio and whatnot but they generally have trivial load.

That said, generally if you're running a multiplayer game as a host you want at least 3 cores, 1 for the main thread, 1 for the AI thread, and 1 for everything else on your system.  With just 2 cores you'd have conflicts with the OS, etc.

Well yes, the game is threaded for 2, but most multi-core processors will offload extra work to other cores with relatively good efficiency. AI War is written for 2 cores, but it's putting load on 4.

Quote from: keith.lamothe
Quote
If you have a system on that level and are experiencing lag, it's more than likely your network.
Either that or you're running on a high speed or have a really active gamestate.  The Insane profile will bring most systems to their knees, that's kind of the point.  The 50ms speed is the normal one, and the others are there to help people get through really-high-ship-count situations in a reasonable amount of real-time.

I usually play with 33ms on single player, and 50ms in multiplayer.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Thank You Arcen!
« Reply #18 on: June 06, 2011, 03:35:47 pm »
Well yes, the game is threaded for 2, but most multi-core processors will offload extra work to other cores with relatively good efficiency. AI War is written for 2 cores, but it's putting load on 4.
Yea, I guess the various instruction-level optimizations let them do a lot of stuff there, though I don't recall any concrete examples of where they can get away with that in the general case.  Basic problem is that the program logic is sequential: you can't have instructions happen in a different order based on the number of cores or some non-deterministic thread splitting, etc.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Echo35

  • Master Member Mark II
  • *****
  • Posts: 1,703
  • More turrets! MORE TURRETS!
Re: Thank You Arcen!
« Reply #19 on: June 06, 2011, 03:49:27 pm »
Well yes, the game is threaded for 2, but most multi-core processors will offload extra work to other cores with relatively good efficiency. AI War is written for 2 cores, but it's putting load on 4.
Yea, I guess the various instruction-level optimizations let them do a lot of stuff there, though I don't recall any concrete examples of where they can get away with that in the general case.  Basic problem is that the program logic is sequential: you can't have instructions happen in a different order based on the number of cores or some non-deterministic thread splitting, etc.


Granted, it's just the start of a game, so not a whole lot going on. Any huge saves lying around I could load and see what happens? :D


Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Thank You Arcen!
« Reply #20 on: June 06, 2011, 03:51:04 pm »
Oh, that's how you were measuring it.  Yea, in our experience the perf-counters on individual-core loads lie like politicians ;)  Often I can't even get a straight answer from my computer as to which program is actually responsible for what percent of CPU load because of kernel-level hooks from antivirus and whatnot.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Echo35

  • Master Member Mark II
  • *****
  • Posts: 1,703
  • More turrets! MORE TURRETS!
Re: Thank You Arcen!
« Reply #21 on: June 06, 2011, 03:56:30 pm »
Oh, that's how you were measuring it.  Yea, in our experience the perf-counters on individual-core loads lie like politicians ;)  Often I can't even get a straight answer from my computer as to which program is actually responsible for what percent of CPU load because of kernel-level hooks from antivirus and whatnot.

I'm not running much else in the background, though with Chrome threading itself like mad, it might be a good idea to close that first, THEN check AI War, or maybe forcing Chrome to only run on Core 7 or something :P

Offline Nalgas

  • Hero Member
  • *****
  • Posts: 680
Re: Thank You Arcen!
« Reply #22 on: June 06, 2011, 06:20:43 pm »
If you have a processor with multiple cores, it will offload the extra work onto the extra cores, just as it will with any game.
Well, actually the game can only use 2 cores to any great efficiency, and only 1 if you're a multiplayer client (rather than the host, which has a separate thread for the AI).  There are a few other threads for audio and whatnot but they generally have trivial load.

That said, generally if you're running a multiplayer game as a host you want at least 3 cores, 1 for the main thread, 1 for the AI thread, and 1 for everything else on your system.  With just 2 cores you'd have conflicts with the OS, etc.

Well yes, the game is threaded for 2, but most multi-core processors will offload extra work to other cores with relatively good efficiency.

I think the words you're looking for are actually "extremely poor efficiency".  There's a reason a lot of stuff doesn't benefit from more cores/processors much, and that's that it's not written to use more threads well/effectively/at all, because that's frequently hard, especially if you didn't design with that in mind.  No matter what kind of fancy tricks your OS and/or hardware try to pull, a single-threaded app is going to largely ignore anything beyond the core it's running on, aside from the benefit of not having to fight for it with other processes that can be stuck elsewhere.  And no matter how many threads you do use, if they're all sitting around waiting on a single one that does most of the work and blocks everything else until it's done, that also results in it not really mattering how many cores you throw at it.

Claiming AI War has better threading than AAA games is also a little silly, too.  AAA games from a few years ago before having multiple cores was common, sure (which is why older games still benefit a lot more from faster individual cores rather than more of them), but not newer ones.  Most of them require at least two cores these days to even be playable, and several of the more recent ones benefit noticeably from having four rather than two.  Multi-threaded game programming has come a long way now that most PCs and all the non-Wii consoles pretty much need to take good advantage of it to get acceptable results.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Thank You Arcen!
« Reply #23 on: June 06, 2011, 06:44:52 pm »
Most of them require at least two cores these days to even be playable, and several of the more recent ones benefit noticeably from having four rather than two.
That's basically where AIW is, except that it's playable on a single core as long as you don't push it too hard.

But yea, multithreading is hard.  Multithreading a simulation that has to execute deterministically the same way on any machine almost to the very smallest detail is a _lot_ harder :)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Cyborg

  • Master Member Mark III
  • *****
  • Posts: 1,957
Re: Thank You Arcen!
« Reply #24 on: June 06, 2011, 07:10:34 pm »
is this normal for everyone else? I loaded up one of my older large games.
Kahuna strategy guide:
http://www.arcengames.com/forums/index.php/topic,13369.0.html

Suggestions, bugs? Don't be lazy, give back:
http://www.arcengames.com/mantisbt/

Planetcracker. Believe it.

The stigma of hunger. http://wayw.re/Vi12BK

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Thank You Arcen!
« Reply #25 on: June 06, 2011, 07:21:01 pm »
What's the context of that list of filenames?
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Nalgas

  • Hero Member
  • *****
  • Posts: 680
Re: Thank You Arcen!
« Reply #26 on: June 06, 2011, 07:54:58 pm »
But yea, multithreading is hard.  Multithreading a simulation that has to execute deterministically the same way on any machine almost to the very smallest detail is a _lot_ harder :)

That's a bit of an understatement.  I get the concepts behind it, but I'm not very good at it in practice so far, particularly not efficiently.  Working my way through some of the OpenCourseWare stuff to get more in the habit of designing things properly so it's easier/less impossible to get it to work, but it's non-trivial (to put it mildly) when you're very used to years of not doing things that way.

What's the context of that list of filenames?

It looks like the Resource Monitor list of files that are currently open/being accessed.  It would be not really all that weird for them to be read while in-game, since it loads those images as-needed (i.e. not until something actually needs to display them) these days, doesn't it?

Offline Cyborg

  • Master Member Mark III
  • *****
  • Posts: 1,957
Re: Thank You Arcen!
« Reply #27 on: June 06, 2011, 08:34:20 pm »
What's the context of that list of filenames?

yeah, it's the resource Monitor.
Kahuna strategy guide:
http://www.arcengames.com/forums/index.php/topic,13369.0.html

Suggestions, bugs? Don't be lazy, give back:
http://www.arcengames.com/mantisbt/

Planetcracker. Believe it.

The stigma of hunger. http://wayw.re/Vi12BK

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Thank You Arcen!
« Reply #28 on: June 06, 2011, 08:48:14 pm »
And the first column of numbers is number of reads of that file?  And the second column is number of writes?  Or what?

If that 256 ff graphic is getting loaded over 10k times in a single run of AI War, I'd say something isn't working right ;)  But I don't know which columns are on display there.

The graphics do load as needed; I don't recall if there's an unload-if-not-used-anymore thing, but I don't see that the big FF graphic would be thrashing like that, too many things use it.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Nalgas

  • Hero Member
  • *****
  • Posts: 680
Re: Thank You Arcen!
« Reply #29 on: June 06, 2011, 08:50:46 pm »
By default, it shows "Read (B/sec)", "Write (B/sec)", "Total (B/sec)", and some other stuff that doesn't fit in that screenshot.