Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
ErIog
Jul 11, 2001

:nsacloud:

Admiral Snuggles posted:

So I'm really freaking proud of the map generator I've made for the game I've been working on. It can make cool maps up to 300,000 tiles using less than a gig of memory. The one in the picture below is about 25,000 tiles, probably closer to what I'll use in the game.

How long does it take to generate the terrain? If your code is generating it procedurally from a random seed then you could just share that initial seed among all players, and have them generate their world for themselves during the initial loading. This is how Spelunky does the Daily Challenges. It also works very well on a much much larger scale with something like Noctis which simulates an entire universe in a few megabytes.

You'll still want to validate all client data in order to prevent cheating, but it could work very well for providing clients with the initial game world.

Also, if your terrain generation does take a significant amount of time then you could modify your algorithm to generate only the pieces of the world that client actually needs. Using the Dwarf Fortress stuff that was just posted as an example, unless the player sets foot in one of those world tiles then there's no need to generate it down to that level of detail. Again, this kind of seed sharing + LOD-aware procedural generation is how Noctis manages to generate literally an entire universe of planets.

ErIog fucked around with this message at 04:20 on Mar 5, 2014

Adbot
ADBOT LOVES YOU

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Admiral Snuggles posted:

So I'm really freaking proud of the map generator I've made for the game I've been working on. It can make cool maps up to 300,000 tiles using less than a gig of memory. The one in the picture below is about 25,000 tiles, probably closer to what I'll use in the game.



My question is. How is something with tons of information like this typically shared in a multiplayer game?

How much information is in a tile? Because if its just a few numbers, an an array of all 25,000 structs would only amount to a few hundred KB. KISS and just send the whole thing uncompressed.

Admiral Snuggles
Dec 12, 2008

:qq: Freedom :qq:
So it seems like I've got a pair of options here, both of which are going to require some re-engineering.

1. Redesign the engine so it uses a single seed (or multiple gridlocked seeds in chunks like minecraft) which describe the world around them procedurally.
2. Instead of storing an array of objects, store an array of structs that describe all the pertinent information about the tiles, and let each client build the objects off the structs.

The problem with #1 is that the way I've got it built. Multiple randomly assigned seeds. And what comes out of those seeds is also random.

I wish I'd started thinking in terms of building off a single seed. But... since I haven't I'm going to redesign it so there's just a struct behind the scenes driving the pertinent information about the tiles. A struct with a string, two floats, and a bool should reduce the overhead dramatically compared to storing tens of thousands of objects.

The performance boost should be huge too. I wish I wasn't such a game programming noob. Thanks guys! :woop:


:frogbon:
Do you guys have an irc or group where you hang out and talk about butts and programming games?

Admiral Snuggles fucked around with this message at 05:32 on Mar 5, 2014

shrughes
Oct 11, 2008

(call/cc call/cc)
With regard to butts, #cobol on irc.synirc.net. With regard to programming games... there's a gamedev or three on there, and some game industry PTSD-havers too.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Admiral Snuggles posted:

So it seems like I've got a pair of options here, both of which are going to require some re-engineering.

1. Redesign the engine so it uses a single seed (or multiple gridlocked seeds in chunks like minecraft) which describe the world around them procedurally.
2. Instead of storing an array of objects, store an array of structs that describe all the pertinent information about the tiles, and let each client build the objects off the structs.

The problem with #1 is that the way I've got it built. Multiple randomly assigned seeds. And what comes out of those seeds is also random.

I wish I'd started thinking in terms of building off a single seed.

That's fine. Use one number to seed the RNG, and everything else derives from there (as long as they all ask for things in the same order). This is how Age of Empires (and a billion other games) do synchronized simulation, so modern machines and networks shouldn't strain.

There are three kinds of state in your game:
  • "random" values, generated from some PRNG whose initial state you control
  • player input
  • things that derive deterministically from the first two

You need to make sure that both sides see numbers out of the PRNG in the same way (125th is the hit roll for unit 0x15af3, 126th is the check for a special item in a chest, etc.), and that player input is processed in the same order, but after that the deterministic part of your simulation takes over. Barring differences in rounding modes or something (beware GPGPU stuff here or reading back from textures), they should stay in sync. Bonus: logging player input and initial seed is enough for a full replay for debugging or sharing purposes. The player input ordering takes some care, for real-time games, but it shouldn't be too bad.

Caveat: I've built a moderately complex synchronized simulation as a toy, and talked with people who have deployed their own in shipping titles, but haven't shipped it in a game.

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

Admiral Snuggles posted:

So it seems like I've got a pair of options here, both of which are going to require some re-engineering.

1. Redesign the engine so it uses a single seed (or multiple gridlocked seeds in chunks like minecraft) which describe the world around them procedurally.
2. Instead of storing an array of objects, store an array of structs that describe all the pertinent information about the tiles, and let each client build the objects off the structs.

The problem with #1 is that the way I've got it built. Multiple randomly assigned seeds. And what comes out of those seeds is also random.

I wish I'd started thinking in terms of building off a single seed. But... since I haven't I'm going to redesign it so there's just a struct behind the scenes driving the pertinent information about the tiles. A struct with a string, two floats, and a bool should reduce the overhead dramatically compared to storing tens of thousands of objects.

The performance boost should be huge too. I wish I wasn't such a game programming noob. Thanks guys! :woop:


:frogbon:
Do you guys have an irc or group where you hang out and talk about butts and programming games?

There's about 80 people at all times on #SAGameDev on synirc. We've fostered a pretty cool community since last year's SAGameDev Challenge and will definitely be the place to hang out for SAGDCIX.

seiken
Feb 7, 2005

hah ha ha

Admiral Snuggles posted:

So I'm really freaking proud of the map generator I've made for the game I've been working on. It can make cool maps up to 300,000 tiles using less than a gig of memory. The one in the picture below is about 25,000 tiles, probably closer to what I'll use in the game.



My question is. How is something with tons of information like this typically shared in a multiplayer game?

Why do you need "less than a gig of memory" for 300,000 tiles that's outrageous. Assuming a byte for each tile (256 possibilities, which is very generous seeing as I can only spot 5 different tiles there) for each tile you should fit 300,000 tiles into 300 KB, which you can compress down to even less, and then the whole sharing problem is completely trivial.

Praseodymi
Aug 26, 2010

So, I'm porting my game's rendering component to SDL and it's gone fine, but for some reason it's capped at 60fps. I haven't put anything in intentionally that would cause this, and it ran fine before when it was non-SDL. Is there some setting I need to consider that could be causing it?

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!

Praseodymi posted:

So, I'm porting my game's rendering component to SDL and it's gone fine, but for some reason it's capped at 60fps. I haven't put anything in intentionally that would cause this, and it ran fine before when it was non-SDL. Is there some setting I need to consider that could be causing it?
Vsync?

Praseodymi
Aug 26, 2010

God-dammit, thanks. That was exactly it.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Capping at 60fps is a good thing. Don't render frames the player will never see.

seiken
Feb 7, 2005

hah ha ha

Suspicious Dish posted:

Capping at 60fps is a good thing. Don't render frames the player will never see.

It's a good thing for proper release builds, sure. During development you probably want to know pretty quick if some feature you added dropped your maximum theoretical framerate from 1000 to 65.

xzzy
Mar 5, 2009

Some people like to run at 120 fps these days because they spent so much goddamn money on their rig they have that much overhead.

Praseodymi
Aug 26, 2010

seiken posted:

It's a good thing for proper release builds, sure. During development you probably want to know pretty quick if some feature you added dropped your maximum theoretical framerate from 1000 to 65.

Yeah, this is exactly it. I'm on a pretty beefy machine, if it can't run my 2D sidescroller well above 60FPS there's something wrong, but I don't have any lovely pcs to test on.

Gummy
Feb 24, 2014
I drop my FPS to 30 and lower in Unity to find any framerate specific problems because I'm a bad programmer. My releases are always Vsynced though.

duck monster
Dec 15, 2004

So I decided to do a double whammy and re-teach myself C++ (I've gotten really loving rusty!) and learn the cocos2dx framework while I'm at it.

So the logical choice is to use the new 3.0 branch.

Holy poo poo what a learning curve. The C++ i can cope with, to a degree. I used to do C++ a couple of decades ago and slowly the old info is re-revealing itself, although the language has changed a bit now (Did you know C++ apparently has gained an iiterator version of for loops? Neat) seemingly for the better. The hard part is they've changed the loving API beyond recognition from 2.0 meaning *ALL* the tutorials don't work, and all those blogposts dont work. And its not just that they've renamed most of the functions (Apparently they are pulling away a bit from the ObjC by dropping the prefix pseudo-namespaces and using proper C++ namespacing. I guess thats a good thing) they are straight up changing how things work.

The upside is those changes are mostly to use the standard library , which is forcing me to learn the standard library all over again. Thats also te downside.

:negative:

Learning is hard when your an old man.

With all that said, Cocos2dx loving owns bones.

shrughes
Oct 11, 2008

(call/cc call/cc)
Man I wish I had time for gamedev :smith:

I guess I mean, I wish I cared to do some side project more than I cared to read the internet and post on SA.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
For me, it's always the boring stuff that I hate doing. I can get a fun prototype going, but it's the stuff like building menus and a state machine that burns me out.

duck monster
Dec 15, 2004

shrughes posted:

Man I wish I had time for gamedev :smith:

I guess I mean, I wish I cared to do some side project more than I cared to read the internet and post on SA.

I use a plugin to block all my timewasting sites (Mostly SA and facebook) on firefox when I want to focus on doing other things. Its really the only thing that will let me overcome my powerful inertia and ADHD like attention span.

It has a bad habit of making my guitar become suddenly interesting though. Thats not really a bad thing however.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Suspicious Dish posted:

For me, it's always the boring stuff that I hate doing. I can get a fun prototype going, but it's the stuff like building menus and a state machine that burns me out.
Yup. A week to make a working game, a month to make AI for it, six months to make even lovely programmer graphics, then until the end of time to make all the loving menus.

VictorGrunn
Feb 15, 2004
Ye Guilty

roomforthetuna posted:

Yup. A week to make a working game, a month to make AI for it, six months to make even lovely programmer graphics, then until the end of time to make all the loving menus.

Oh, thank Christ, it's nice to see someone else say this. I've been working at this solo for a while and I started to think something was wrong with me for absolutely despising the UI work most of all every time I code up a game.

duck monster
Dec 15, 2004

roomforthetuna posted:

Yup. A week to make a working game, a month to make AI for it, six months to make even lovely programmer graphics, then until the end of time to make all the loving menus.

"Hey facebook, are any of you guys any good at doing pixel art?"

...

...

...

...

"Anyone?"

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

VictorGrunn posted:

Oh, thank Christ, it's nice to see someone else say this. I've been working at this solo for a while and I started to think something was wrong with me for absolutely despising the UI work most of all every time I code up a game.

Scaleform is loving amazing if you can license it. I've done Scaleform contracting work for a few commercial projects. It's good.

superh
Oct 10, 2007

Touching every treasure
I'm starting to feel like something's wrong with me, I love ui work! Getting those tweens just right is a great feeling. That and engine work.

Content production, level design, and balance can go to hell though. I get so incredibly bored.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

superh posted:

Content production, level design, and balance can go to hell though. I get so incredibly bored.
Sounds like procedural generation is for you!

superh
Oct 10, 2007

Touching every treasure

roomforthetuna posted:

Sounds like procedural generation is for you!

drat right it is. Or hand the project off to someone else! Problem solved!

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

VictorGrunn posted:

Oh, thank Christ, it's nice to see someone else say this. I've been working at this solo for a while and I started to think something was wrong with me for absolutely despising the UI work most of all every time I code up a game.
It isn't just UI, it's polish work. You're hitting that "the last 10% is 90% of the work" barrier that stops a ton of people from making finished games. There is no getting around it, you just kind of push yourself through it and hate life for however long it takes.

It gets easier and vaguely less painful after you've done it a few times, if it's (EDIT: any) consolation. :unsmith:

Shalinor fucked around with this message at 20:15 on Mar 6, 2014

OtspIII
Sep 22, 2002

Shalinor posted:

It isn't just UI, it's polish work. You're hitting that "the last 10% is 90% of the work" barrier that stops a ton of people from making finished games. There is no getting around it, you just kind of push yourself through it and hate life for however long it takes.

It gets easier and vaguely less painful after you've done it a few times, if it's consolation. :unsmith:

I actually kind of love polish, but UI is still soul-crushing. Adding juice is super satisfying, since you really get to see your game make huge leaps forward in feel every day. UI work always just feels like a slog, though.

Baldbeard
Mar 26, 2011

Is it natural to feel pretty satisfied with individual classes and then feel like it turns into a clusterfuck when you try to plug everything in and get communication between classes going? I keep finding myself writing parts of games in isolated bubbles and then having trouble piecing it all together. Never sure if it's better to start over, or keep jerryrigging it to completion as a learning experience.

xzzy
Mar 5, 2009

Baldbeard posted:

Is it natural to feel pretty satisfied with individual classes and then feel like it turns into a clusterfuck when you try to plug everything in and get communication between classes going? I keep finding myself writing parts of games in isolated bubbles and then having trouble piecing it all together. Never sure if it's better to start over, or keep jerryrigging it to completion as a learning experience.

I think it's normal. Unless you have the ability to design your interfaces and program design perfectly before writing any code, there's always going to be integration issues.

Sepist
Dec 26, 2005

FUCK BITCHES, ROUTE PACKETS

Gravy Boat 2k

OtspIII posted:

One of my classmates actually wrote a paper on this. I think his conclusion was that there are some fairly easy ways to make it significantly harder for people to submit fake scores that basically nobody does (I think he said there was one exception among major scoreboard hosts that he found, which I think was the Apple Game Center). Taking this step won't stop people from being able to do it if they're dedicated, but it does raise the effort barrier to the point where you can at least get rid of the majority of them. If this is something people are interested I could ask him some more about it and write about it here.

I did this. Since I can only use http to post scores to an online scoreboard in SQL, I made my own "encryption" by doing an algorithm client side then checking the answer server side in php, basically a lame version of private keys. If you wireshark traffic sent by my game and try to repost it with a bogus score it will fail, and although it could be cracked, people with better use of their time wouldn't bother. It took me like 2 hours to come up with it so not doing it is just lazy.

thetroof
Jul 4, 2010

I think we got something here
Somebody reminded me that this thread existed, figured I should say hello because I also make games. I'm currently working at Wargaming Seattle (formerly Gas Powered Games). I consider myself a generalist, but lately have been focused on physics and ballistics. I have about ten half-started personal projects that I'd be interested in sharing and or working on with some goons sometime. Just saying hello though. Cheers.

Paniolo
Oct 9, 2007

Heads will roll.
You guys have a billboard in unincorporated Redmond advertising that you are hiring. It is very strange and you might be the only game studio ever to hire via billboard.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Paniolo posted:

You guys have a billboard in unincorporated Redmond advertising that you are hiring. It is very strange and you might be the only game studio ever to hire via billboard.

Ubi did all sorts of crazy poo poo in Montreal when I was living there. Billboards on trucks, I think some people in sandwich boards.

thetroof
Jul 4, 2010

I think we got something here

Paniolo posted:

You guys have a billboard in unincorporated Redmond advertising that you are hiring. It is very strange and you might be the only game studio ever to hire via billboard.

Yeah. I don't think anybody has applied because they saw one of those. That said, I love working there. It still has the small studio feel of GPG (because it is the same place and people), everybody gets to have a ton of creative freedom, and it's just an awesome environment. Such a nice change of pace after working for a large corporation (MS). I like it a lot.

thetroof fucked around with this message at 06:10 on Mar 7, 2014

dupersaurus
Aug 1, 2012

Futurism was an art movement where dudes were all 'CARS ARE COOL AND THE PAST IS FOR CHUMPS. LET'S DRAW SOME CARS.'
A deposit for our collective Unity knowledge base. If, when doing a development build for iOS, you get the error "Unable to insert branch island," turn off dSYM in "Debug Information Format." If you get that error with dSYM off, it's because the dll generated by mono with all your stuff is too big. Time to turn on code stripping, or move some of your stuff to Plugins.

I got to spend 4-5 hours wondering why the lines

code:
m_userBG.transform.localPosition = new Vector3(0, m_background.transform.localPosition.y - m_background.transform.localScale.y);
m_userBG.transform.localScale = new Vector3(m_background.transform.localScale.x, m_iconTexture.transform.localScale.y + PADDING + PADDING);
would cause a linker error. It turns out those two lines were enough to push it over the size limit.

Pollyanna
Mar 5, 2005

Milk's on them.


I'm looking to do something new for my next app, and I want to try learning web game development. Is there a recommended beginner framework, or a well-liked tutorial website?

Red Mike
Jul 11, 2011

Pollyanna posted:

I'm looking to do something new for my next app, and I want to try learning web game development. Is there a recommended beginner framework, or a well-liked tutorial website?

I quite like Pixi.JS for rendering, or Phaser for a full game framework (built on Pixi.JS for rendering).

xgalaxy
Jan 27, 2004
i write code
IMO you should look into TypeScript game frameworks.
It's turning into a pretty awesome language with first class Visual Studio support.

Adbot
ADBOT LOVES YOU

down with slavery
Dec 23, 2013
STOP QUOTING MY POSTS SO PEOPLE THAT AREN'T IDIOTS DON'T HAVE TO READ MY FUCKING TERRIBLE OPINIONS THANKS
Phaser is a TypeScript framework

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply