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
Juc66
Nov 20, 2005
Lord of The Pants
Steam protection is pretty easy. Upload your exe to a certain place then it wraps it and spits out a copy protected exe, no muss no fuss.

Adbot
ADBOT LOVES YOU

Mug
Apr 26, 2005

Juc66 posted:

Steam protection is pretty easy. Upload your exe to a certain place then it wraps it and spits out a copy protected exe, no muss no fuss.

When I buy a game, I expect a certain level of DRM based on the platform I am buying it on and no more. I expect Steam games to require me to use Steam to launch them; no CD keys no activations no GFWL etc. I expect Origin to use origin, Gog.com to use nothing. If I go to an indie game developers' website, I expect the transaction to be almost exactly the same as buying a Humble Bundle. I pay using paypal, and I download it through their site directly and I can come back as often as I want and re-download it. I can make as many copies of the game as I want to every PC I feel like in my house and run it without ever having an internet connection on any of them or typing in any codes or bullshit to install/run the game.

I don't use DRM as an excuse to go pirate a game, I own heaps of games with agressive DRM, but I know heaps of people will use it as an excuse.

Mug
Apr 26, 2005
How often do you guys have an idea for something to put in your game, but you have to create a little prototype of the idea working stand-alone before trying to put it into your game?

I am slowly building up a little folder called "Prototypes" and its just got a ton of programs in it that perform basic routines that I've eventually moved into my game code after I got it the way I wanted. I have a little program that is just a black screen demonstrating bullets flying around, one that generates vision cones and draws them, and I'm making one now where you just click on a black screen to spawn an explosion.

Do youse sometimes make prototypes in programming languages other than the one your game runs in so you can quickly bang something out to see how it feels before integrating it? I'm just interested to hear how other people go about this kind of thing.

Regalia
Jun 11, 2007

Mug posted:

How often do you guys have an idea for something to put in your game, but you have to create a little prototype of the idea working stand-alone before trying to put it into your game?

I am slowly building up a little folder called "Prototypes" and its just got a ton of programs in it that perform basic routines that I've eventually moved into my game code after I got it the way I wanted. I have a little program that is just a black screen demonstrating bullets flying around, one that generates vision cones and draws them, and I'm making one now where you just click on a black screen to spawn an explosion.

Do youse sometimes make prototypes in programming languages other than the one your game runs in so you can quickly bang something out to see how it feels before integrating it? I'm just interested to hear how other people go about this kind of thing.

That is actually how I program all of my projects, and not just for game ideas, but for the framework stuff as well. I find it's a lot easier to reason about and test an idea in isolation. And since you can tests things in isolation, if it doesn't work when you add it to the game, you know (to a reasonable degree of certainty) the problem is in the intergration somewhere.

I guess what I'm really doing is writing small, very specific libraries. It forces you to write the game in a modular way, which is A Good Thing.

Because I thouroughly test each idea, I write it in the game language so I know I can just drop it in without having to re-write anything.

GetWellGamers
Apr 11, 2006

The Get-Well Gamers Foundation: Touching Kids Everywhere!
So, out of curiosity, anyone ever submitted a game to the IGF, student or pro?

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

GetWellGamers posted:

So, out of curiosity, anyone ever submitted a game to the IGF, student or pro?
Yeah, I submitted The Savage Garden. (on the Professional side of the contest)

... mind, though, that it was an extremely rough prototype, and I would lay odds that we were one of the entries that the judges didn't even bother playing. It has since undergone a massive transformation into a product of a scope that I might actually be able to finish.

We snagged a professional voice actor for the protagonist, though, and her narration in the video got us a lot of compliments :unsmith:

GetWellGamers
Apr 11, 2006

The Get-Well Gamers Foundation: Touching Kids Everywhere!
Well, okay, can you go into it a bit? I mean, do you just submit and it flies off into the void? Do you gt any kind of feedback on its status before february, or what?

Any details would be helpful.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

GetWellGamers posted:

Well, okay, can you go into it a bit? I mean, do you just submit and it flies off into the void? Do you gt any kind of feedback on its status before february, or what?

Any details would be helpful.
You really just follow the instructions. You sign up, pay your $100, and then you get a little interface page where you do your submission. You enter your video, images, build, instructions, short explanation, etc. After that initial upload, you can go back in and edit any of the details, update the build, and pretty much anything else.

The actual build submission is done via FTP. You're given a specific folder to upload to. You can continue to upload builds after your initial, though you need to be sure to explain which build is the newest one in your instructions. Got any questions, email them - they're pretty responsive.

There's a substantial window after the contest closes to when the judges actually get around to trying your build, so plan on continuing to develop on it and add bug fixes as you go.


The other gotcha is that they've slightly changed the submission rules this year. I believe there's something about not allowing games that are already on the market, or maybe it was they only want games that will be ready for market within the next year?

GetWellGamers
Apr 11, 2006

The Get-Well Gamers Foundation: Touching Kids Everywhere!
The big rule change I saw was that you couldn't submit, sell your game, and then re-submit. But I think that's just an extension of the "You can only be a finalist once" rule, both of which I think were a more or less direct response to Fez.

Mug
Apr 26, 2005
Making a game has forced me to go from knowing zero trigonometry to being able to draw circles, lines at radial angles, and now elipses (aka explosions!).

https://www.youtube.com/watch?v=BhlmDUxX_rs

Added a "ExplosiveRound" bool to my bullet class, and weapons can cause explosions of different sizes that expand at different rates and do different amounts of damage.

Stopping them from going through walls took some serious thought.

Nition
Feb 25, 2006

You really want to know?

Mug posted:

How often do you guys have an idea for something to put in your game, but you have to create a little prototype of the idea working stand-alone before trying to put it into your game?

I am slowly building up a little folder called "Prototypes" and its just got a ton of programs in it that perform basic routines that I've eventually moved into my game code after I got it the way I wanted. I have a little program that is just a black screen demonstrating bullets flying around, one that generates vision cones and draws them, and I'm making one now where you just click on a black screen to spawn an explosion.

Do youse sometimes make prototypes in programming languages other than the one your game runs in so you can quickly bang something out to see how it feels before integrating it? I'm just interested to hear how other people go about this kind of thing.

I've found this sort of thing to be a really good idea for two reasons:
1. It forces you to create something that's standalone rather than getting all tied into your current project, so it can be a lot easier to reuse elsewhere.
2. It's often way easier to test when you don't have all these other variables going on in your main app.

Mug
Apr 26, 2005

Nition posted:

I've found this sort of thing to be a really good idea for two reasons:
1. It forces you to create something that's standalone rather than getting all tied into your current project, so it can be a lot easier to reuse elsewhere.
2. It's often way easier to test when you don't have all these other variables going on in your main app.

Prior to the work I did in the above video, I made a prototype where you click on a black screen and it draws expanding elipses on a per-pixel basis.

I grabbed the code and dropped it into my game loop and worked it all in, but the elipses would never work, they were all just single pixels. Took me loving ages to realize my prototype defined "Pi" and my main game never did anywhere.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Mug posted:

Making a game has forced me to go from knowing zero trigonometry to being able to draw circles, lines at radial angles, and now elipses (aka explosions!).

https://www.youtube.com/watch?v=BhlmDUxX_rs

Added a "ExplosiveRound" bool to my bullet class, and weapons can cause explosions of different sizes that expand at different rates and do different amounts of damage.

Stopping them from going through walls took some serious thought.
EDIT: Completely misread that as "will take some serious thought." Removing giant wall of text.

Seriously, though. Looks freaking awesome.

Shalinor fucked around with this message at 00:59 on Sep 23, 2012

Mug
Apr 26, 2005

Shalinor posted:

You might try clipping. Each time you expand the explosion ring, clip the circle against any nearby walls. The result would be a bunch of line segments that would define the new edge of your explosion.

To transmit explosions through doorways, detect the case where an explosion is clipped against a wall containing a doorway, and create a new small explosion on the "inside" side of that wall, such that it only emits into the room, not back out to the side where the other explosion already is.

... and, as it happens, that same approach could model sound transmission pretty spiffily. I'd be worried about performance, though, unless you're really careful about how often you recalculate the edge/interior of an explosion sound wotsit.

(also: game looks freaking amazing)

The clipping is all done now.

The explosions consts of 36 dots that expand outwards, one for every 10 degrees. When an explosion first spawns, all 36 dots are "Valid", but each time one hits a clipping object, it becomes "Invalid" and dies forever for that explosion. The clipping plane already contains things like "Wall" "See-Through wall" "shoot-through-able object" "Closed Door" "Open Door" so I don't need to do anything special to handle doorways.

Doing things fast was the main concern.

Shalinor posted:

EDIT: Completely misread that as "will take some serious thought." Removing giant wall of text.

Seriously, though. Looks freaking awesome.

Haha I quoted your original post, then came back and saw your edited, expanded version, and now this.

edit: redacted some text for the time being until I have something to show for it

Mug fucked around with this message at 01:25 on Sep 23, 2012

ambushsabre
Sep 1, 2009

It's...it's not shutting down!
[x-post between the two game dev threads]
Forums user the chaos engine just made a trailer for our iphone/ipad video game irrupt. We spent tons of money on materials and marketing professionals, so hopefully it was worth it and you guys enjoy it.

https://www.youtube.com/watch?v=9lywRmY3H5A

The game was made in about a month using Futile for Unity. I highly recommend it although you have to be self-reliant because there's literally no documentation for it.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

ambushsabre posted:

marker'ing professionals
Also, cute video, though some additional zoom on the pages would have been nice. There are a few cases where you can't make out the words / where you turn the page too soon.

Polo-Rican
Jul 4, 2004

emptyquote my posts or die

ambushsabre posted:

[x-post between the two game dev threads]
Forums user the chaos engine just made a trailer for our iphone/ipad video game irrupt. We spent tons of money on materials and marketing professionals, so hopefully it was worth it and you guys enjoy it.

https://www.youtube.com/watch?v=9lywRmY3H5A

The game was made in about a month using Futile for Unity. I highly recommend it although you have to be self-reliant because there's literally no documentation for it.

Wait, are you saying you paid the chaos engine "tons of money" to make that trailer? Or do you mean that you spent money marketing it in other ways? Not going to sugar coat this, Irrupt has a really fantastic visual style and that trailer does NOT do it justice in any way, shape, or form. I recommend replacing it with just a gameplay vid + subtitles, because the art seriously rules and will sell the game on its own.

edit: I'm Very Dumb

Polo-Rican fucked around with this message at 22:51 on Sep 23, 2012

Toastline
Dec 7, 2005
Chain Chomp

Mug posted:

How often do you guys have an idea for something to put in your game, but you have to create a little prototype of the idea working stand-alone before trying to put it into your game?

I am slowly building up a little folder called "Prototypes" and its just got a ton of programs in it that perform basic routines that I've eventually moved into my game code after I got it the way I wanted. I have a little program that is just a black screen demonstrating bullets flying around, one that generates vision cones and draws them, and I'm making one now where you just click on a black screen to spawn an explosion.

Do youse sometimes make prototypes in programming languages other than the one your game runs in so you can quickly bang something out to see how it feels before integrating it? I'm just interested to hear how other people go about this kind of thing.

I do that all the time! Mostly with complex-looking visual effects or really basic gameplay things. I was actually considering to gather up around 40-something of my prototypes and experiments, and make them into a single program and see if I could sell it, because people seem to like them. But I don't know if that's such a good idea. Anyone have thoughts on that?

edit: here's an example of a thing. It slowly draws procedurally generated mathematical figures whenever you press r. (It's a windows executable and you'll want to be sure to extract it before running it)

Toastline fucked around with this message at 22:57 on Sep 23, 2012

Kunzelman
Dec 26, 2007

Lord Shaper
Ladies and gentlemen, the powers of sarcasm!

Polo-Rican
Jul 4, 2004

emptyquote my posts or die

Kunzelman posted:

Ladies and gentlemen, the powers of sarcasm!

You're probably right, but with goons, you seriously never know.

high on life and meth
Jul 14, 2006

Fika
Rules
Everything
Around
Me

Polo-Rican posted:

You're probably right, but with goons, you seriously never know.

No worries, it's just for fun. Thanks for the kind words about Irrupt!

Fur20
Nov 14, 2007

すご▞い!
君は働か░い
フ▙▓ズなんだね!
SPRITESHEET SUNDAY 2

Today I'll put up a full spritesheet for an angry sheep.

It doesn't actually damage you in the game and its only purpose is to keep you from getting a treasure it's standing right on top of. I'm especially proud of how it always looks like it's glaring at the player character (unless you're standing directly above it). It was also supposed to just kinda lazily chew the grass, but changing frames every 0.1s makes it look like it's feasting angrily, which is perhaps even better for its purposes.

The first stage is pretty much finished, I just need to put in the actual treasures and write the code for when you pick them up. It'd be great if I could go at the rate of like a level a week, but I know myself best and it probably won't even be twice that timeframe, haha.

Mug
Apr 26, 2005
loving I forgot about spritesheet sunday and I only invented it last week.

I spent all Sunday building my creature hearing/sounding system so there's no graphics to go with that :(

GetWellGamers
Apr 11, 2006

The Get-Well Gamers Foundation: Touching Kids Everywhere!
Spritesheet Sunday? Heck, I'm game.

(Timg'd for table-breakage)

high on life and meth
Jul 14, 2006

Fika
Rules
Everything
Around
Me
BANG

Lord Humongus
Apr 10, 2009

ice ice baby :toot:
Hey guys, so I tried to make a way for the darkness to despawn and spawn at the right times, but I think it might look a bit bad?

http://www.stencyl.com/game/play/14712

Lord Humongus fucked around with this message at 18:12 on Sep 24, 2012

Polo-Rican
Jul 4, 2004

emptyquote my posts or die

Lord Humongus posted:

Hey guys, so I tried to make a way for the darkness to despawn and spawn at the right times, but I think it might look a bit bad?

http://www.stencyl.com/game/play/14712

It looks weird because the light / dark tiles are a bit big. How hard would it be to increase the tile count? If they were about a quarter of the size I think it would look fine.

Fur20
Nov 14, 2007

すご▞い!
君は働か░い
フ▙▓ズなんだね!
Now I've never claimed programming to be my strong point--just good enough to get things working without the universe imploding-- but I've been checking my task manager with my game open and have gathered the following data:

On an i5 quad core, it usually runs at <1% (displays as 00) CPU and peaks at around 3% between stages before falling back to <1. This, I'm cool with this, I must be doing something right, haha.

It's the memory consumption I'm worried about : whenever I go to a new stage, it seems like it's loading all the PNG data into RAM, if that's even how it works. This seems to be a pretty static value and only increases at very noticeably set times (i.e. transitioning between stages and the world map). Even though the PNG data falls out of use, it looks like the RAM doesn't get flushed and it hovers around ~250-300MB, increasing by about 4-10kb every time you go back to a screen you've already been to, and proportionally to a screen's data size the first time you go to it while the program is running.

At the size rate of the screens that I'm using, it'll probably come out to be about 1GB if everything gets loaded. I mean this isn't really a problem in this age of "16GB of top-quality-brand top-speed RAM costs $120," but conceptually I don't really like this. Is there a way to flush your memory usage in XNA? And if there is, is that even a good idea?

Nition
Feb 25, 2006

You really want to know?

The White Dragon posted:

Now I've never claimed programming to be my strong point--just good enough to get things working without the universe imploding-- but I've been checking my task manager with my game open and have gathered the following data:

On an i5 quad core, it usually runs at <1% (displays as 00) CPU and peaks at around 3% between stages before falling back to <1. This, I'm cool with this, I must be doing something right, haha.

It's the memory consumption I'm worried about : whenever I go to a new stage, it seems like it's loading all the PNG data into RAM, if that's even how it works. This seems to be a pretty static value and only increases at very noticeably set times (i.e. transitioning between stages and the world map). Even though the PNG data falls out of use, it looks like the RAM doesn't get flushed and it hovers around ~250-300MB, increasing by about 4-10kb every time you go back to a screen you've already been to, and proportionally to a screen's data size the first time you go to it while the program is running.

At the size rate of the screens that I'm using, it'll probably come out to be about 1GB if everything gets loaded. I mean this isn't really a problem in this age of "16GB of top-quality-brand top-speed RAM costs $120," but conceptually I don't really like this. Is there a way to flush your memory usage in XNA? And if there is, is that even a good idea?

Re going to the same screen increasing RAM each time:
I'm no expert on XNA (or programming!) so someone might be able to give you a better answer, but in C# you don't usually want to manually clear out objects from RAM, you just want to make sure the're free for the garbage collector to do it itself.

It's likely that when you go back to those screens, something's being created each time that isn't getting de-referenced afterwards. Something that the garbage collector thinks is still being used.

There might be a way in XNA to see what objects it thinks are currently in use. If there is, then you can just go to the same screen 20 times or whatever, then look for the object you have 20+ of when you should only have one. Although the garbage collector won't act instantly so it's worth waiting a few seconds (or more) after testing as well.

Otherwise it's more about making sure everything you created temporarily is dereferenced - setting temporary arrays to null and that sort of thing. The garbage collector is actually pretty complicated as well; Microsoft has a good page on it: http://msdn.microsoft.com/en-us/library/ms973837.aspx

Juc66
Nov 20, 2005
Lord of The Pants

The White Dragon posted:

Now I've never claimed programming to be my strong point--just good enough to get things working without the universe imploding-- but I've been checking my task manager with my game open and have gathered the following data:

On an i5 quad core, it usually runs at <1% (displays as 00) CPU and peaks at around 3% between stages before falling back to <1. This, I'm cool with this, I must be doing something right, haha.

It's the memory consumption I'm worried about : whenever I go to a new stage, it seems like it's loading all the PNG data into RAM, if that's even how it works. This seems to be a pretty static value and only increases at very noticeably set times (i.e. transitioning between stages and the world map). Even though the PNG data falls out of use, it looks like the RAM doesn't get flushed and it hovers around ~250-300MB, increasing by about 4-10kb every time you go back to a screen you've already been to, and proportionally to a screen's data size the first time you go to it while the program is running.

At the size rate of the screens that I'm using, it'll probably come out to be about 1GB if everything gets loaded. I mean this isn't really a problem in this age of "16GB of top-quality-brand top-speed RAM costs $120," but conceptually I don't really like this. Is there a way to flush your memory usage in XNA? And if there is, is that even a good idea?

I've never used XNA so I'm going to make some assumptions here.

XNA should have a garbage collector of some sort (I'm assuming it does) which should clear the memory for your unused data.
What you probably need to be doing is making sure that all references to garbage data are broken so that the garbage collector knows the data is trash and that it should remove it.


edit: haha, looks like I'm slightly too slow at typing

The Cheshire Cat
Jun 10, 2008

Fun Shoe

The White Dragon posted:

Now I've never claimed programming to be my strong point--just good enough to get things working without the universe imploding-- but I've been checking my task manager with my game open and have gathered the following data:

On an i5 quad core, it usually runs at <1% (displays as 00) CPU and peaks at around 3% between stages before falling back to <1. This, I'm cool with this, I must be doing something right, haha.

It's the memory consumption I'm worried about : whenever I go to a new stage, it seems like it's loading all the PNG data into RAM, if that's even how it works. This seems to be a pretty static value and only increases at very noticeably set times (i.e. transitioning between stages and the world map). Even though the PNG data falls out of use, it looks like the RAM doesn't get flushed and it hovers around ~250-300MB, increasing by about 4-10kb every time you go back to a screen you've already been to, and proportionally to a screen's data size the first time you go to it while the program is running.

At the size rate of the screens that I'm using, it'll probably come out to be about 1GB if everything gets loaded. I mean this isn't really a problem in this age of "16GB of top-quality-brand top-speed RAM costs $120," but conceptually I don't really like this. Is there a way to flush your memory usage in XNA? And if there is, is that even a good idea?

I don't know a lot about XNA specifically so I apologize if this comes off as very generic advice, but hopefully it will still be helpful to you.

What I'm guessing is probably happening is that image data has to be manually unloaded from memory if you want to free the space up again. Garbage collection could unload it if you've got nothing pointing to it, but the thing about garbage collection is it's not the end all solution to memory management - all it does is prevent you from creating memory that you can't possibly recover without closing the program. As people mentioned in the previous posts that were made as I was typing all this up, it's generally a bad idea to just try to flush your RAM, assuming the API lets you do it at all. The most you'll ever want to do along those lines is manually call the garbage collector, and even then it's usually not necessary since most garbage collectors are just set up to run exactly when they're needed anyway.

What you need to do if you want to clean up your memory usage is take a look at your program and see how your images are actually being loaded in. I'm guessing it's probably something like you've got a game object which has a 2dImage value (made up class name, just substitute with whatever is appropriate), which you probably create a new instance of when you define that object. Example:

code:
EnemyShip ship = new EnemyShip(new 2dImage("\imagedata\ship.png"));
Might be how you create a new instance of an enemy if you were doing it wrong. I say "doing it wrong" because what this will do is load the same image data into memory as a new object every time you instantiate another ship (It's totally possible that your class might be "smart" and recognize this to automatically point new things at the previously created image objects, but unless you wrote it yourself you shouldn't assume that). I'm assuming you're not doing this; however, the reason I bring it up is that in this example, your image data WOULD be garbage collected just by setting the ship reference to null. The garbage collector would dump the orphaned EnemyShip object, which would orphan the 2dImage object, which the garbage collector dumps next pass, and it's all gone.

Now, what I assume you're probably doing is pre-loading your graphics with a factory class of some kind, and instantiating your game objects something like this:

code:
constructor:
2dImage shipGraphic = new 2dImage("\imagedata\ship.png");

newShips:
EnemyShip ship1 = new EnemyShip(shipGraphic);
EnemyShip ship2 = new EnemyShip(shipGraphic);
//etc.
(but like, with an array or hash table or something better than named variables for every object. I'm just trying to keep my examples simple!)

Which is good, and more efficient. Here's the key though: As long as an instance of the factory class exists, the garbage collector will never free the image data from memory (If it's a static class, one technically exists for the entire duration of the program). The reason being that even if you dereference all your game objects, there's still going to be that 2dImage object (shipGraphic in the example) sitting there ready for use by the next thing you ask the factory class to make for you. This is fine within a level since you're probably going to need to keep making use of that graphic data, but between levels you'll need to set up some system to dereference graphics you know you won't need for the next one. There's a couple ways you might do this:

A) If your factory class is instantiated instead of static and only loads graphics into memory the first time it needs them, you can just create a new one and point your factory variable to that instead of the old one. Then the garbage collector will come along and dump the old one along with anything it's still got loaded into itself. The downside here is that you're going to spend a lot of time reloading the same graphics if you happen to share certain ones between levels. If it front loads everything this will also seriously slow down level transitions since it's going to load your entire graphics library into memory every time.

B) A more efficient option is to define resource tables for each of your levels - a lot of older games do stuff like this which is why in say, Jagged Alliance 2, mods will allow you to build sandbags in-game, but only on levels that already have them (because on the levels that don't, the object/graphics data isn't loaded into memory). Then when you change levels, you have your factory object look at the table for the next level and compare it to the data it's already got loaded - it keeps anything that's also used in the next level, and only loads in stuff that hasn't been seen yet. Finally it dumps all the stuff that it has loaded but is not referenced in the table for the next level. This way if you have a lot of objects that reoccur frequently you won't have to constantly reload their graphics, but you still trim the fat for things that you know you won't be needing in the near future. The best way to produce the tables for a level is to just set up a level design tool that does it for you and saves it with the level data.

So hopefully that helps. I don't know how your game is set up specifically so I kind of tried to cover as many bases as I could. If it's all tl;dr, you might want to check out this thread where you can post code snippets and probably get much more specific answers from people who actually know how XNA works.

The Cheshire Cat fucked around with this message at 22:10 on Sep 24, 2012

Fur20
Nov 14, 2007

すご▞い!
君は働か░い
フ▙▓ズなんだね!

The Cheshire Cat posted:

Now, what I assume you're probably doing is pre-loading your graphics with a factory class of some kind, and instantiating your game objects something like this:

Oh yeah, I been doin' it the "right way" the whole time.

"If it's all the same factory class reference, it won't dispose of things even if they don't 'exist' anymore as long as the factory class instance still does" is exactly the problem I'm having, I call everything with the one spriteBatch = new SpriteBatch(GraphicsDevice) and figured it would dispose of whatever was no longer needed as it became irrelevant in the code, but as you describe, that's not the case.

Well, chalk that one up to "the unprotected course notes I took from some UK professor's site to learn C#/XNA from didn't really go into that." But I guess that's probably to be expected from a programming teacher who doesn't even bother/know how to electronically protect their uploaded teaching materials.

Cool, that actually kinda makes sense, thanks. I think I might be able to maneuver with that somehow, barring some catastrophic logic rules problem haha.

Nition
Feb 25, 2006

You really want to know?
The Cheshire Cat, that's a way better reply than mine and I think I learned something too.

Can I just clarify, you're saying that if I made 50 clone ships from shipGraphic, none of them will get collected until I've cleared the reference to shipGraphic itself?

Nition fucked around with this message at 22:22 on Sep 24, 2012

seiken
Feb 7, 2005

hah ha ha
ChesireCat you went to a lot of effort on that great post so I don't mean to annoy or anything, but I saw you (not exclusively, a couple people did it) use "dereference" to mean "set variables referencing [the object] to null". I think this isn't the correct term and in a programming context it already has a meaning (getting the value a pointer points to) so calling it that could be a little confusing, even though it's a reasonable name for it otherwise. I don't know what the correct term is since I rarely use garbage-collected languages, sorry! :coal:

seiken fucked around with this message at 22:45 on Sep 24, 2012

omeg
Sep 3, 2012

For troubleshooting .NET memory management problems I highly recommend CLR Profiler. Great utility for tracking GC issues.

Books On Tape
Dec 26, 2003

Future of the franchise
I'm making an iOS rpg-ish kind of game, with the only online component being a list of other random players that you can pull up and duel/pvp with, sort of like how all those bad mafia wars type games do it.

For implementing something like this, there's no avoiding using a web service/database that my app connects to to store/retrieve every player's data, is there?

The Cheshire Cat
Jun 10, 2008

Fun Shoe

Nition posted:

The Cheshire Cat, that's a way better reply than mine and I think I learned something too.

Can I just clarify, you're saying that if I made 50 clone ships from shipGraphic, none of them will get collected until I've cleared the reference to shipGraphic itself?

Not exactly - each clone instance will be garbage collected, so you'll free up the memory being used for data related to individual instances (like the variables representing their health and so on), but the graphical data and any other data shared by every ship (like weapon definitions or whatever) will still be referenced by your base object that you defined when you instantiated your factory. Basically think about it like this: if, after you clone your object, you assign new objects to any of the clone's variables, those objects will be cleaned up with the clone if you remove all references to said clone.

So you won't end up with 50 clone ships floating around in memory with nothing referencing them after you drop them from your main game tree (or however you have them stored), but the bulk of memory use in most games is graphical and sound data, which will still be referenced by your factory object.

seiken posted:

ChesireCat you went to a lot of effort on that great post so I don't mean to annoy or anything, but I saw you (not exclusively, a couple people did it) use "dereference" to mean "set variables referencing [the object] to null". I think this isn't the correct term and in a programming context it already has a meaning (getting the value a pointer points to) so calling it that could be a little confusing, even though it's a reasonable name for it otherwise. I don't know what the correct term is since I rarely use garbage-collected languages, sorry! :coal:

You're right about that; I'm bad with terminology. It's tempting to use "dereference" the way I did because it doesn't really come up with most modern languages (C++ is kind of a holdout), but yeah it's not really what that term means. I don't what the correct term is for what I'm talking about either. It seems like there should be one. "Unreference"?

The Cheshire Cat fucked around with this message at 23:48 on Sep 24, 2012

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!
White Dragon,

If you're still having problems and if you're willing to share your code with me, I'd be happy to hunt down your memory problem and then explain what I did to find it. Send me a PM or if you can't do that, post your code and/or your email address and/or ask me for mine.

Fur20
Nov 14, 2007

すご▞い!
君は働か░い
フ▙▓ズなんだね!
Oh, naw, thank you so much for the offer but it's cool, that won't be necessary. I have no reservations about sharing my crap code--it's nowhere near revolutionary and according to my bro in the DE, I'm using pretty much the exact same ground/wall detection as Sonic 1--but I'm 99% certain I got my poo poo sorted. It's ungraceful, but I can at least revert to my old memory-eating, if working, state if it starts fuckin' things up in the long run.

Adbot
ADBOT LOVES YOU

Senso
Nov 4, 2005

Always working

Mug posted:

How often do you guys have an idea for something to put in your game, but you have to create a little prototype of the idea working stand-alone before trying to put it into your game?

I am slowly building up a little folder called "Prototypes" and its just got a ton of programs in it that perform basic routines that I've eventually moved into my game code after I got it the way I wanted. I have a little program that is just a black screen demonstrating bullets flying around, one that generates vision cones and draws them, and I'm making one now where you just click on a black screen to spawn an explosion.

Which IDE do you use and how do you deal with having separate smallish projects? Let's say I'm using Visual Studio, it would be a pain to setup a new project with all the particular bindings and settings, just for a prototype. I wonder if there is an easy way to do that.

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