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
OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Paniolo posted:

Structuring code is as much or more a factor of the organization of the team working on it than the function of the code itself, so you may want to keep that in mind when you take a look at some existing projects. Things that are best practices for a large team working on a reusable engine are not necessarily going to be a very good idea for a hobby project with one or two coders.
It's also a function of what your game needs to do. Things like saves, out-of-scope objects (i.e. almost everything in a sandbox), level transitions vs. stream-in, multiplayer, physics, and your lighting model all have severe effects on how the rest of your game will be designed. Even reusable engines have to nail some of those aspects down before they can do much.

Adbot
ADBOT LOVES YOU

Mug
Apr 26, 2005

duck monster posted:

Are you doing this in qbasic? Because if so, that is wonderfully anachronistic and awesome.

It's QB64 there, which is QuickBASIC 4.5 ported to Windows so the language is identicle. It was originally running in DOS QuickBASIC 4.5 until I ran out of RAM and got sad.

edit: you can see the development history at https://www.manfightdragon.com.au

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!

roomforthetuna posted:

Basically, my question is what's the best way syntactically to do component-based design in Actionscript3?
Well, I made a way that works, it's pretty ugly though. An interface that makes any object into a component, consisting of returning a component-type, a list of triggers (name and function that gets called) and an integer priority, so that "update" triggers can be sorted into an order. When a component is added to an actor, its triggers are added to the actor, and the parentage is mapped in a static map of such things (thus saving me from having to put a parent variable into every class that implements "component"). Also, all 'update' triggers are duplicated into a static list of update triggers, so that those can be played out without having to iterate through actors for it, and so that the priority order can be applied outside of actors.

It's a loving mess internally, but it's a nice convenient interface externally. It's frustrating that there's not some sort of standard object for this behavior in more languages. I realize Unity and Stencyl are both based around approximately that structure.

duck monster
Dec 15, 2004

Mug posted:

It's QB64 there, which is QuickBASIC 4.5 ported to Windows so the language is identicle. It was originally running in DOS QuickBASIC 4.5 until I ran out of RAM and got sad.

edit: you can see the development history at https://www.manfightdragon.com.au

If my grandfather was alive, he'd shake your hand. He went to the grave 5 years ago (nearly 90years old) still convinced that "All this structured and object oriented garbage" was a fad and people would return to the TRUE languages of computing, Fortran and basic (preferably on a VMS mainframe).

I believe he also said something to the effect of "Only drat queers affect a LISP" in regards to functional programming.

Yeah, dude was pretty old school, but he was still hacking away on his ancient old lovingly maintained 486 with qbasic (or was it an even older variant, I forget) right to the end. Admittedly he did think visual basic was "useful" although he grumbled that nobody could possibly ever organize their code properly without line numbers lol. Old scientists where cut from a different (read "stubborn") cloth back then.

shodanjr_gr
Nov 20, 2007

OneEightHundred posted:

It's also a function of what your game needs to do. Things like saves, out-of-scope objects (i.e. almost everything in a sandbox), level transitions vs. stream-in, multiplayer, physics, and your lighting model all have severe effects on how the rest of your game will be designed. Even reusable engines have to nail some of those aspects down before they can do much.

Yeah I am aware of that. I have narrowed down the scope pretty well (its a 2D SHMUP-ish concept) and I don't plan on doing everything from the ground up (I'm looking into using a write-once-publish-anywhere game engine such as Corona that publishes to Android/iOS - I'd consider Unity too but the Android/iOS + basic license plugins end up being quite expensive for an "experiment".).

Looking at something like id Tech for inspiration is a bit out of scope since lots of things are heavily decoupled (client/server architecture/VMs/etc).

Mug
Apr 26, 2005

duck monster posted:

If my grandfather was alive, he'd shake your hand. He went to the grave 5 years ago (nearly 90years old) still convinced that "All this structured and object oriented garbage" was a fad and people would return to the TRUE languages of computing, Fortran and basic (preferably on a VMS mainframe).

I believe he also said something to the effect of "Only drat queers affect a LISP" in regards to functional programming.

Yeah, dude was pretty old school, but he was still hacking away on his ancient old lovingly maintained 486 with qbasic (or was it an even older variant, I forget) right to the end. Admittedly he did think visual basic was "useful" although he grumbled that nobody could possibly ever organize their code properly without line numbers lol. Old scientists where cut from a different (read "stubborn") cloth back then.

Just wrote the following line of code
IF PopupBox.AnimationProgress > 0 AND PopupBox.AnimationProgress < 1 THEN PopupBox.AnimationProgress = PopupBox.AnimationProgress + .075 ELSE IF PopupBox.AnimationProgress > 1 THEN PopupBox.AnimationProgress = 1

Channelling your granddaddy over here.

edit: Which causes this nice little popup dialogue to unfurl in a nice smooth motion.



The hovering popup box is actually 11 "Cubes" that all smoothly pop out the top of an object when you click on it and build a dialogue box. Now I have to actually build a GUI onto them. Going to be fun trying to make an isometric windows interface on the face of it.

Mug fucked around with this message at 15:50 on Jul 4, 2012

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Hah, that's cute.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

duck monster posted:

If my grandfather was alive, he'd shake your hand. He went to the grave 5 years ago (nearly 90years old) still convinced that "All this structured and object oriented garbage" was a fad and people would return to the TRUE languages of computing, Fortran and basic (preferably on a VMS mainframe).

I believe he also said something to the effect of "Only drat queers affect a LISP" in regards to functional programming.

Yeah, dude was pretty old school, but he was still hacking away on his ancient old lovingly maintained 486 with qbasic (or was it an even older variant, I forget) right to the end. Admittedly he did think visual basic was "useful" although he grumbled that nobody could possibly ever organize their code properly without line numbers lol. Old scientists where cut from a different (read "stubborn") cloth back then.
Just gotta say - your grandpa sounds completely awesome.

To be fair, I'm sure most of us will eventually be crankily touting how C++ is good enough for everyone, and how all of these drat "interpreted" languages are turning out a generation of lazy, good-for-nothing script kiddies that won't know what to do if memory-related problems appear. "JIT, more like JITNT" we'll say with a wry, a knowing smirk, snapping our suspenders and turning back to a Star Trek TNG rerun.

xzzy
Mar 5, 2009

Pfft, interpreted languages.

By the time I'm 90 years old I suspect kids will program with voice commands. Except it won't be programming, it'll be "computer, make a program that illustrates the knight's tour" and the AI will run a google search, find whatever libraries or code is necessary, and execute it on the fly.

It'll be like that chick on Bones who somehow manages to come up with elaborate mystery-solving algorithms during commercial breaks, but without the commercial breaks.

duck monster
Dec 15, 2004

Mug posted:

Just wrote the following line of code
IF PopupBox.AnimationProgress > 0 AND PopupBox.AnimationProgress < 1 THEN PopupBox.AnimationProgress = PopupBox.AnimationProgress + .075 ELSE IF PopupBox.AnimationProgress > 1 THEN PopupBox.AnimationProgress = 1

Channelling your granddaddy over here.

He'd probably wonder what this dot syntax nonsense about, and wheres the drat line number son.

I remember him once utterly guffawing about the folly of an article in Amstrad Action where a guy wrote a clock on the computer without a single goto, all using gosubs. "The hoops this guy went through to just bloat the drat stack! Doesnt he understand memory at all????? What if he got recursion going? Memory'd all run out and then lord knows what would happen!!!!". And then wondered out loud whether my grandmother would approve an amstrad perched beside the bed to make alarm sounds in the morning. "Nothing wrong with my alarm radio!".

e: He wasn't really as stuborn as I make it out. He was pretty useful when I was learning Pascal in high school, and for all his dislike of structured, he understood it very well, and according to one of his old workmates, the big old PDP where he worked that ran Unix, he actually coded some instrument monitoring stuff (he worked in the chemistry field) in C , apparently quite effectively. Anyway, sorry abou derailing with the grandpa chat. I just enjoy talking about the old man that first taught me to code. :) e2: And my grandma can STIll kick my rear end on galaga.

e2:

quote:

The "dot syntax" is just a TYPE, you can use TYPEs in QBasic 1.1 and above.
Well, yeah. I know that. Doesn't mean ghost of departed BASIC grandpa would aprove however! Re Amstrad. The amstrad was my second computer. Prior to that I had something called a "Dick Smith Wizzard", a rebranded funvision with 4k memory and one of the most primitive non microsoft BASIC implementations you'll encounter. Eventually my family gota 6128 (With some assistance from my grandfather of course, who got it because he felt it necessary I had a real computer) and it was a technological marvel. 128K ram (although only 64K was really available, the other 64K only useful via switchable 16k banks) , mac resolution graphics, etc, etc, etc.

duck monster fucked around with this message at 06:20 on Jul 5, 2012

Mug
Apr 26, 2005
The "dot syntax" is just a TYPE, you can use TYPEs in QBasic 1.1 and above.

Obviously you couldn't use them on the Amstrad though, hah. My first PC was an Amstrad CPC464. I'm not actually that old, my family was just poor.

chglcu
May 17, 2007

I'm so bored with the USA.

quiggy posted:

That appears to have fixed the exception problem, thanks.

Unfortunately, now it's not displaying a libtcod window. The code is as simple as it comes, so I'm not quite certain what's going wrong here.
code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using libtcod;

namespace HelloWorldRL
{
    class Program
    {
        static void Main(string[] args)
        {
            TCODConsole.initRoot(80, 50, "Hello, world!");
            TCODConsole.flush();
            TCODSystem.sleepMilli(1000);
        }
    }
}

Yeah, I decided to give this a try since I'm also considering writing a roguelike to kill some time. For me at least, it seems to be dying inside initRoot(). Not throwing an exception or anything, just killing the process. Not sure what's going on there. Looks like the .net bindings haven't been updated in two years, so maybe the unmanaged libtcod build its using has a bug.

chglcu fucked around with this message at 03:59 on Jul 5, 2012

xgalaxy
Jan 27, 2004
i write code
Just a wild shot in the dark, but, main is missing [STAThread].
This can cause problems if using Windows.Form... But I'm not familiar enough with libtcod to say if that is the case here.

Also another thing it could be is you may not have the appropriate visual studio c++ runtime version installed. Make sure you have the same c++ runtime the library was compiled with.

xgalaxy fucked around with this message at 04:10 on Jul 5, 2012

chglcu
May 17, 2007

I'm so bored with the USA.
Actually, just found it. Have to call TCODConsole.setCustomFont before initRoot, apparently. I don't think [STAThread] is required, since this is just a managed wrapper around a library using SDL, which underneath will be using Win32.

On a somewhat unrelated note, it would be really nice if managed wrapper authors would make their wrappers use the .net framework naming conventions. Having mixes of different styles drives me crazy.

Edit: Looks like part of the problem is that the managed wrapper distribution doesn't come with the terminal.png font, which libtcod expects to be available as a fallback. Bringing in that file from the normal libtcod distribution allows the call to setCustomFont to be skipped.

chglcu fucked around with this message at 04:19 on Jul 5, 2012

quiggy
Aug 7, 2010

[in Russian] Oof.


prolecat posted:

Actually, just found it. Have to call TCODConsole.setCustomFont before initRoot, apparently. I don't think [STAThread] is required, since this is just a managed wrapper around a library using SDL, which underneath will be using Win32.

On a somewhat unrelated note, it would be really nice if managed wrapper authors would make their wrappers use the .net framework naming conventions. Having mixes of different styles drives me crazy.

Edit: Looks like part of the problem is that the managed wrapper distribution doesn't come with the terminal.png font, which libtcod expects to be available as a fallback. Bringing in that file from the normal libtcod distribution allows the call to setCustomFont to be skipped.

My god you've figured it out. Thank you very much, I was starting to think that I was going crazy.

chglcu
May 17, 2007

I'm so bored with the USA.

quiggy posted:

My god you've figured it out. Thank you very much, I was starting to think that I was going crazy.

No problem. Looks like libtcod will actually output an error message about not being able to load terminal.png if its missing, but I wasn't seeing it since I had my project set as a Windows application instead of console. Might be helpful to set up an output redirector to get those messages into the debug window if the library's standard error handling is to output and die.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?
Kind of at a fork in my design, and could use some input. What I'm working on is a procedural platformer (and not a Cloudberry Kingdom bot run thing, I mean platforming that feels good to navigate and explore).

On the one hand, I could try for more heavy procedural obstruction design. Lots of platforms at varying heights/spacings, with some attempt to quantify what makes a level "hard" or "easy" or "smooth" or "janky". This does give me theoretically infinite variation, but I feel like short of spending years on it, it will also invariably feel samey. The variety possible is limited by the codebase, and the kind of codebase it would take for true variety would be a spaghetti nightmare. I mean look at Cloudberry... he spent 2+ years on that, and while yes it looks fun for a very specific kind of gamer, those levels become a samey "hold right and time your jumps" thing almost instantly.

On the other hand, I could just embrace my Wang tileset code, and focus instead on making a variety of tiles. Hundreds of tiles, each with different obstruction types, and each with different sub-obstructions that are themselves Wang-spawned. Things like "I design this house with 3 rooms, this with 4, this with 8, etc, and then those rooms are spawned from a set of room types, and the lamps in those room come from a set of lamps, and any furniture in those rooms comes from..." Furthermore, when I do platforms in these, I could still make them semi-procedural, and wiggle them a bit to change up the jumping, or add or remove platforms at times - but within controllable parameters that keep all generated levels fun and distinct.


Right now, I'm leaning toward #2. I think it will let me inject character into the zones that would otherwise be missing, and the time spent per any one tile will be minimal. It's also roughly the approach that Spelunky uses, and I know that works (I just have to go a bit more designed, since I don't have the luxury of players using bombs et al to fix otherwise unsolvable levels).

... but can anyone make a compelling case for #1? To the best of my knowledge, even rougelikes use something closer to #2 (make a hallway, now add some rooms, and those rooms can be...).

Shalinor fucked around with this message at 17:21 on Jul 5, 2012

Unormal
Nov 16, 2004

Mod sass? This evening?! But the cakes aren't ready! THE CAKES!
Fun Shoe

Shalinor posted:

Kind of at a fork in my design, and could use some input. What I'm working on is a procedural platformer (and not a Cloudberry Kingdom bot run thing, I mean platforming that feels good to navigate and explore).

On the one hand, I could try for more heavy procedural obstruction design. Lots of platforms at varying heights/spacings, with some attempt to quantify what makes a level "hard" or "easy" or "smooth" or "janky". This does give me theoretically infinite variation, but I feel like short of spending years on it, it will also invariably feel samey. The variety possible is limited by the codebase, and the kind of codebase it would take for true variety would be a spaghetti nightmare. I mean look at Cloudberry... he spent 2+ years on that, and while yes it looks fun for a very specific kind of gamer, those levels become a samey "hold right and time your jumps" thing almost instantly.

On the other hand, I could just embrace my Wang tileset code, and focus instead on making a variety of tiles. Hundreds of tiles, each with different obstruction types, and each with different sub-obstructions that are themselves Wang-spawned. Things like "I design this house with 3 rooms, this with 4, this with 8, etc, and then those rooms are spawned from a set of room types, and the lamps in those room come from a set of lamps, and any furniture in those rooms comes from..." Furthermore, when I do platforms in these, I could still make them semi-procedural, and wiggle them a bit to change up the jumping, or add or remove platforms at times - but within controllable parameters that keep all generated levels fun and distinct.


Right now, I'm leaning toward #2. I think it will let me inject character into the zones that would otherwise be missing, and the time spent per any one tile will be minimal. It's also roughly the approach that Spelunky uses, and I know that works (I just have to go a bit more designed, since I don't have the luxury of players using bombs et al to fix otherwise unsolvable levels).

... but can anyone make a compelling case for #1? To the best of my knowledge, even rougelikes use something closer to #2 (make a hallway, now add some rooms, and those rooms can be...).

In my experience, areas that you want to feel "natural" (outdoorsy) tend to benefit more from technique #1, whereas areas tend to feel more "indoor" when done with technique #2.

Like you said, to some extent it's a flase dichotomy, since you can combine both procedural and wang-tile-style areas.

I think you're more likely to get the feel you want (metroidvaniay?) with a wang tile approach.

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
From my experience working with a friend on an unfinished procedural platformer that used #1 last year, I don't think it could ever result in something with good, satisfying variety, or anything even close to what a person could design. He actually made a fairly granular variety of heights/spacing, which could result in some wild areas, but the overall effect was repetitive. The code is pretty simple, but maybe you're right that better variety would've required something more complicated. Maybe part of the problem was requiring everything to be solvable, I'm not sure. That said, I like Spelunky, but also find it's levels to be rather samey.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Shalinor posted:

... but can anyone make a compelling case for #1? To the best of my knowledge, even rougelikes use something closer to #2 (make a hallway, now add some rooms, and those rooms can be...).
It depends a LOT on what type of challenge you're aiming for.

The big problem with any automated generation is that platformer challenges are very specific and technical. This isn't like a roguelike where the exact room shape and object placement probably doesn't matter THAT much, placement of environment details and objects are everything in a platformer. Most challenges are based on doing things like forcing the player to deal with an enemy in a narrow movement area, or doing something predictably and then throwing them off with a slight variant (i.e. almost every floating platform segment). It's very hard to produce that procedurally, and very hard to staple together prefabs of it without beign repetitive.

The only exception I can think of is something like Metroid, where the environment is more maze-like and platform challenges are more for content gating than they are maneuverability challenges, and enemy challenges come more from the small movement area than specific geometry.

OneEightHundred fucked around with this message at 22:26 on Jul 5, 2012

Jo
Jan 24, 2005

:allears:
Soiled Meat
I'm curious about whether or not a certain kind of tool exists. I have a spritesheet with actors in various poses and stages of motion. I'd like the tool to be able to load this sprite sheet, then let me add various 'states'. For each state, I'd like to be able to add an arbitrary number of frames to form an animation, then save these animations to a text file.

code:
+----------------------------+-------+
| The spritesheet goes here  |State  |
| O  \ O /                   |   Name|
|---  \-/                    |Add/Rem|
| |    |                     +-------+
|/ \  / \                    |Anim   |
|| |  | |                    | Frames|
|                            |Add/Rem|
+----------------------------+-------+
Doesn't seem that hard to mock up, but I'd rather be sure one doesn't exist before making the effort.

Mug
Apr 26, 2005
I just made my own, dunno if a good one exists already. Took me like 2 days in QBasic and I'm not very good at this kind of thing.

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!
Why would you use QBasic?

Unormal
Nov 16, 2004

Mod sass? This evening?! But the cakes aren't ready! THE CAKES!
Fun Shoe

Orzo posted:

Why would you use QBasic?

Why wouldn't you use QBasic? :iia:

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

Orzo posted:

Why would you use QBasic?

You're one of those GW-Basic elitists, hunh?

Unormal
Nov 16, 2004

Mod sass? This evening?! But the cakes aren't ready! THE CAKES!
Fun Shoe

Internet Janitor posted:

You're one of those GW-Basic elitists, hunh?

If we're being honest, Applesoft BASIC is clearly the best basic.

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!

Unormal posted:

If we're being honest, Applesoft BASIC is clearly the best basic.
Nonsense, Sinclair/Spectrum BASIC is the best, because you could type 'PRINT' (and most other instruction-words) in one keystroke! Some of them even on keys that were intuitive, unlike J for LOAD.

ExiledTinkerer
Nov 4, 2009
Strange things continue to be afoot in the land of BASIC...like this crazy thing that makes the reasonable assumption that you want to leverage DX11 and such for sheer unbridled power~

http://www.nuclearglory.com/products/nb/ NuclearBASIC

Also I guess PureBASIC is still chugging on along, though there was supposed to be some kinda weird deal with The Game Creators on something...

The Glumslinger
Sep 24, 2008

Coach Nagy, you want me to throw to WHAT side of the field?


Hair Elf
So going back to a project I worked on during the school year, it has one major bug left that I could never fix (due to spending all of my time working on a more important game project).

So it is a racing game, and the bug is that when I hit the wall at a certain angle, I stop completely. The angle is somewhere in the neighborhood of 45 degrees when comparing the direction of the front of the car to the wall. At steeper angles and shallower angles, it works properly, changing your speed based on the angle of collision.

Anyone ever run into something similar? I'm fairly sure my math is right, but whatever.

EDIT: Welp, the last version of the code on my computer must be missing some important updates and I lost perforce access after graduation :smithicide:

The Glumslinger fucked around with this message at 03:25 on Jul 9, 2012

Bocom
Apr 3, 2009

No alibi
No justice
No dream
No hope

Jo posted:

Spritesheet animation tool

I don't know if one exists, I just made my own using C# and XNA.



It's solid, I can create animations with it just fine. It's not completely finished, though.

I think it basically explains the type of tool you're looking for? Unless I'm mistaken.

Bocom fucked around with this message at 05:12 on Jul 9, 2012

Jo
Jan 24, 2005

:allears:
Soiled Meat

Bocom posted:

I don't know if one exists, I just made my own using C# and XNA.



It's solid, I can create animations with it just fine. It's not completely finished, though.

I think it basically explains the type of tool you're looking for? Unless I'm mistaken.

That's perfect. Is it shared somewhere?

JGTheSpy
Jul 31, 2002
Excuse me, but if I could have a moment of your time, I'd like to explain why you're not actually enjoying that game that you're enjoying. You see, I am in fact an expert. At games. I know, it's impressive.

Jo posted:

I'm curious about whether or not a certain kind of tool exists. I have a spritesheet with actors in various poses and stages of motion. I'd like the tool to be able to load this sprite sheet, then let me add various 'states'. For each state, I'd like to be able to add an arbitrary number of frames to form an animation, then save these animations to a text file.

code:
+----------------------------+-------+
| The spritesheet goes here  |State  |
| O  \ O /                   |   Name|
|---  \-/                    |Add/Rem|
| |    |                     +-------+
|/ \  / \                    |Anim   |
|| |  | |                    | Frames|
|                            |Add/Rem|
+----------------------------+-------+
Doesn't seem that hard to mock up, but I'd rather be sure one doesn't exist before making the effort.

It's probably not what you're looking for but I use an app called Sprite Something on my iPad for this and I think it's fantastic. I think it used to be just a pixel editor but now it does sprite sheets, animations, and tile maps as well. It exports to csv, animated GIF, and some other stuff including Flixel scripts. It's pretty awesome.

TJChap2840
Sep 24, 2009
I am not familiar with other languages, but why would you use a tool like that in XNA when all you have to do is import a spritesheet and loop through the frames?

I am genuinely curious because I feel like there is something simple I am missing.

Mug
Apr 26, 2005

TJChap2840 posted:

I am not familiar with other languages, but why would you use a tool like that in XNA when all you have to do is import a spritesheet and loop through the frames?

I am genuinely curious because I feel like there is something simple I am missing.

I've never used XNA, but you usually need to customize the information you store about a "Character" beyond more than just the sheet of frames it uses, so you'd consider building a character file.

I have a massive sheet of animation frames that feature all the frames of animation for all the genders and races of my characters at all different states, and then I create a "Sprite Bank" which explains what frame is "North Facing Female African Firing Weapon" and so on.

Then I have a "Campaign File" which features (among a ton of other things) what "Sprite Bank" each in-game creature uses.

TJChap2840
Sep 24, 2009

Mug posted:

I've never used XNA, but you usually need to customize the information you store about a "Character" beyond more than just the sheet of frames it uses, so you'd consider building a character file.

I have a massive sheet of animation frames that feature all the frames of animation for all the genders and races of my characters at all different states, and then I create a "Sprite Bank" which explains what frame is "North Facing Female African Firing Weapon" and so on.

Then I have a "Campaign File" which features (among a ton of other things) what "Sprite Bank" each in-game creature uses.

So, it's basically used to keep large projects organized? The small projects I mess around with don't really require that much, but I can definitely see more complete projects getting out of hand.

Also, is what you explained something you just came up with? The more I read this thread, the more I feel inadequate because most of you speak as if some of this stuff is common knowledge.

Mug
Apr 26, 2005

TJChap2840 posted:

So, it's basically used to keep large projects organized? The small projects I mess around with don't really require that much, but I can definitely see more complete projects getting out of hand.

Also, is what you explained something you just came up with? The more I read this thread, the more I feel inadequate because most of you speak as if some of this stuff is common knowledge.

It's just something I came up with. I start out hard coding things, then as scale increases I make things more dynamic, and then I make a tool to create the dynamics in a pretty graphical way.

Jo
Jan 24, 2005

:allears:
Soiled Meat

TJChap2840 posted:

I am not familiar with other languages, but why would you use a tool like that in XNA when all you have to do is import a spritesheet and loop through the frames?

I am genuinely curious because I feel like there is something simple I am missing.

Not all of my animation frames are the same size. I have multiple animations on one page.

Deki
May 12, 2008

It's Hammer Time!
I've been learning a shitload while working on my game, which is great, but on the same token, I now know that a lot of code that I wrote earlier in the project works really should have be handled differently, as this was my first major game project in c++ and Allegro 5. I want to go back and rewrite a lot of it, like how I parse in game data/map information, but at the same time, I don't want to spend a lot of time working on something that later on, I'll have to redo anyway when I discover an even better way of doing it.
:negative:

Edit: To rephrase this better, would it be better for me to go back and change non optimal, but working, code. Or would it be better to keep on working on new sections and optimize everything once it is all functionally complete.

Deki fucked around with this message at 20:31 on Jul 9, 2012

xgalaxy
Jan 27, 2004
i write code

Deki posted:

I've been learning a shitload while working on my game, which is great, but on the same token, I now know that a lot of code that I wrote earlier in the project works really should have be handled differently, as this was my first major game project in c++ and Allegro 5. I want to go back and rewrite a lot of it, like how I parse in game data/map information, but at the same time, I don't want to spend a lot of time working on something that later on, I'll have to redo anyway when I discover an even better way of doing it.
:negative:

Edit: To rephrase this better, would it be better for me to go back and change non optimal, but working, code. Or would it be better to keep on working on new sections and optimize everything once it is all functionally complete.

Keep moving.
There is always something that can be done better.
If you get stuck on trying to 'do it right' you will never get anything done.

Adbot
ADBOT LOVES YOU

xzzy
Mar 5, 2009

Only optimize when you find performance problems. Programmers loooove to get hung up on writing perfect code, but it's pretty rare that they actually need to.

Note that this doesn't justify writing terrible code. Your basic flow still needs to be well thought out or else you'll make refactoring a lot more difficult.

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