Author Topic: Quick, Dumb Technical Question  (Read 9842 times)

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Quick, Dumb Technical Question
« on: March 21, 2013, 12:54:35 am »
Man, it's been a while since I have asked something like this.

I know that the AI runs on a different thread than the main engine simulation, but my question is whether there are 2 AI threads (one for each AI player), or just 1?

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Quick, Dumb Technical Question
« Reply #1 on: March 21, 2013, 12:49:55 pm »
Just 1 AI thread :)

The 2 AI players do a lot of things separately, but in a real sense it's just you versus "the AI".  That's one of the reasons I don't really refer to it in the plural.
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 TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Quick, Dumb Technical Question
« Reply #2 on: March 22, 2013, 12:01:35 pm »
I know we have talked about parallelizing the main engine in the past, and the general response was that it was possible, but it would require so much headache inducing work to ensure that clients still work deterministically for network sync purposes that it probably isn't worth it compared to fixing up bugs, balance issues, and developing new game. That I get.

However, what about parallelizing the graphic rendering? Aren't there some good frameworks for that? Are there good frameworks for abstracting this so it isn't very painful (just say "draw" this "batch" of stuff, and the framework or the video driver or the video card would try to split it up if it can), and take care of how video cards and drivers expect it for you?
Plus, as it is a graphic thing, you don't have to worry about network sync. The exact pixels of the "pretty pictures" that on the screen don't influence what the engine thinks is happening.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Quick, Dumb Technical Question
« Reply #3 on: March 22, 2013, 12:07:39 pm »
Unity actually uses a multithreaded renderer now.  If only we could update.
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 Cinth

  • Core Member Mark II
  • *****
  • Posts: 2,527
  • Resident Zombie
Re: Quick, Dumb Technical Question
« Reply #4 on: March 22, 2013, 01:59:32 pm »
Unity actually uses a multithreaded renderer now.  If only we could update.

Wasn't that planned at one point?  I seem to remember some chatter about moving AIW to unity back around the time AS was being worked on. 
Quote from: keith.lamothe
Opened your save. My computer wept. Switched to the ST planet and ship icons filled my screen, so I zoomed out. Game told me that it _was_ totally zoomed out. You could seriously walk from one end of the inner grav well to the other without getting your feet cold.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Quick, Dumb Technical Question
« Reply #5 on: March 22, 2013, 02:15:00 pm »
AIW has been on Unity since late 2010.  I meant it'd be nice if we could update to the newer version of Unity.
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 Cinth

  • Core Member Mark II
  • *****
  • Posts: 2,527
  • Resident Zombie
Re: Quick, Dumb Technical Question
« Reply #6 on: March 22, 2013, 02:34:38 pm »
My phone gets a penalty for auto-co-wrecking.  That post is missing a word I was pretty sure I punched in.  I'm in the middle of a move myself and I miss being able to do this on a real pc.  5 more days  :(

Yeah... post is missing a 4. That particular 4 should be following unity. That statement would have made a bit more sense if it said "move to unity 4".

And I agree. Love when I start a new game and it stutters like it runs at 17the fps (noticeable fast slideshow).  And it only gets worse from there (for me). 
« Last Edit: March 22, 2013, 02:51:02 pm by Cinth »
Quote from: keith.lamothe
Opened your save. My computer wept. Switched to the ST planet and ship icons filled my screen, so I zoomed out. Game told me that it _was_ totally zoomed out. You could seriously walk from one end of the inner grav well to the other without getting your feet cold.

Offline Aklyon

  • Core Member
  • *****
  • Posts: 2,089
Re: Quick, Dumb Technical Question
« Reply #7 on: March 22, 2013, 02:51:14 pm »
AIW has been on Unity since late 2010.  I meant it'd be nice if we could update to the newer version of Unity.
The one with the runtime loading slowness, or something like that?

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Quick, Dumb Technical Question
« Reply #8 on: March 22, 2013, 02:58:05 pm »
The one with the runtime loading slowness, or something like that?
Yea.  That came after the one which totally borked how we play sounds.
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 TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Quick, Dumb Technical Question
« Reply #9 on: March 22, 2013, 03:06:29 pm »
The one with the runtime loading slowness, or something like that?
Yea.  That came after the one which totally borked how we play sounds.

Has anyone else reported to Unity about these issues? Wouldn't these regressions hurt many games, some of which with a bigger "clout" then you guys? (No offense of course, but Unity does have bigger clients in terms of how much money they can get from them, and thus will probably pay more attention to those bug reports first)

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Quick, Dumb Technical Question
« Reply #10 on: March 22, 2013, 03:17:00 pm »
They fixed the sound thing, iirc, but then there was the runtime loading thing.

We've reported that and they've asked for a reproducible case, but when we slimmed down a version to a very basic case it stopped reproducing (at least as noticeably), so we don't really know what was going on and don't have a week to fiddle with making it happen, etc.

But Valley2 on unity 4 was taking 3 seconds to load individual image files.  Didn't matter if we started 1 image load or 30 concurrently, it'd take 3 seconds.  But we can't spool all the requests at once so that's something like a minimum of 30 seconds startup time.  And the impact is much worse in the actual gameplay as any image that has to "pop in" takes 3 seconds to show up.  We preload most things before they're needed but it's not always possible to do it for everything.
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 TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Quick, Dumb Technical Question
« Reply #11 on: March 22, 2013, 03:27:29 pm »
They fixed the sound thing, iirc, but then there was the runtime loading thing.

We've reported that and they've asked for a reproducible case, but when we slimmed down a version to a very basic case it stopped reproducing (at least as noticeably), so we don't really know what was going on and don't have a week to fiddle with making it happen, etc.

But Valley2 on unity 4 was taking 3 seconds to load individual image files.  Didn't matter if we started 1 image load or 30 concurrently, it'd take 3 seconds.  But we can't spool all the requests at once so that's something like a minimum of 30 seconds startup time.  And the impact is much worse in the actual gameplay as any image that has to "pop in" takes 3 seconds to show up.  We preload most things before they're needed but it's not always possible to do it for everything.

(Note, not very famility with Unity3D)

Are you talking about loading through AssetBudle's, or through Resource Folders? (I would expect resource folders, given that you use a plain old file folder structure instead of trying to pack things into archives)

Or is it something else entirely?

If you want, I can take a stab at trying to create a reproducing case for you guys...

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Quick, Dumb Technical Question
« Reply #12 on: March 22, 2013, 03:51:19 pm »
We're trying to avoid AssetBundle's because then the graphics could only be changed by someone with a copy of Unity, and not on the fly like modders or like we want to do during development.

So we use the UnityEngine.WWW class to load stuff off disk.  It's the way the Unity folks have given to folks asking about runtime loading of raw assets (as opposed to baked-in or pre-bundled stuff).
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!