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
CHEESE-kun
May 20, 2004

by Peatpot
Alright, thanks!

Adbot
ADBOT LOVES YOU

CHEESE-kun
May 20, 2004

by Peatpot
Back with another question, I've messed around for hours but I just don't get it.

I'm basically porting this game to D3D10 as an exercise. The hills are billboards; 256 color textures that have had their mask color converted to {0,0,0,0} and are then alpha tested in the pixel shader. I calculate the texture coordinates in the exact same way as the Unreal OpenGL renderer.

However, as is clear in the picture, sometimes it seems the sampling slightly wraps around, resulting in a 1px line where the high mountains on the opposite side of the texture start. Does D3D10 just sample differently? Is there a trick I can use to catch this? I've tried shifting the texture coordinates by one texel but this results in way worse artifacts as the texture's obviously really magnified.

If I understand correctly this problem is to be expected with MSAA enabled (as the sampling kernel would wrap around), by why does it happen here, with no MSAA at all?

POKEMAN SAM
Jul 8, 2004

CHEESE-kun posted:

Back with another question, I've messed around for hours but I just don't get it.

I'm basically porting this game to D3D10 as an exercise. The hills are billboards; 256 color textures that have had their mask color converted to {0,0,0,0} and are then alpha tested in the pixel shader. I calculate the texture coordinates in the exact same way as the Unreal OpenGL renderer.

However, as is clear in the picture, sometimes it seems the sampling slightly wraps around, resulting in a 1px line where the high mountains on the opposite side of the texture start. Does D3D10 just sample differently? Is there a trick I can use to catch this? I've tried shifting the texture coordinates by one texel but this results in way worse artifacts as the texture's obviously really magnified.

If I understand correctly this problem is to be expected with MSAA enabled (as the sampling kernel would wrap around), by why does it happen here, with no MSAA at all?

There was a post about this on the XNA forums last year. Unfortunately I don't remember the name of the topic, and I don't really know what to look for.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
Looks like what's happening is that it's hitting the space between the last texel column and the first one, causing it to interpolate with the first one.

Is the texture flagged as clamp-to-edge?

Is there anything signifying that the surface shouldn't wrap?

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
DirectX10's texture sampling rules have changed from DirectX9. Also look here for more info.

CHEESE-kun
May 20, 2004

by Peatpot
Alright, I solved the problem. It wasn't the .5 offset thing (I'm not doing screen space stuff). Messing around in the editor I noticed that if I disabled masking for those hills, they did show a line in the original renderer. Then it hit me that I was doing the alpha testing for the masked textures with a filtered sampler. Switching the sampler to a point one cleared the problem up. That's why with the exact same coordinates there were different results; I just messed up my alpha testing code (trivial as it might be), while it was a standard feature of older APIs.

Thanks for the help anyway guys!

Rupert Buttermilk
Apr 15, 2007

🚣RowboatMan: ❄️Freezing time🕰️ is an old P.I. 🥧trick...

I'm a sound/music guy working on a mac. I really, really want to get into working with game developers in programming sound. What's my best approach? Should I learn programming, and if so, what language? Is there any way to test my work, say if I were working in something like FMOD? I have a bit of experience and understanding of Xact. I get how it works, and what sort of things it can do, albeit not completely.

I guess I mean that I'm stuck in a place where I want to help with/do sound programming, but I don't have anyone with a game that needs it, so how can I practice and hone my skills on my own?

krysmopompas
Jan 17, 2004
hi

Rupert Buttermilk posted:

I'm a sound/music guy working on a mac. I really, really want to get into working with game developers in programming sound. What's my best approach? Should I learn programming, and if so, what language? Is there any way to test my work, say if I were working in something like FMOD? I have a bit of experience and understanding of Xact. I get how it works, and what sort of things it can do, albeit not completely.
As a sound designer, the most useful programming you can learn is that which can automate tasks for you - batch renaming files, batch converting, import and merge VO drops, etc. I've seen people use everything from Perl to batch files to Python to do this; so it's not really important what language you use so long as you use it well and it can accomplish the tasks you need.

Nobody uses xact, it's worthless. We used it once for debugging a reverb issue, but that's all.

Whether you're using wwise, fmod or some in-house solution for the audio backend isn't that important since the brunt of your time is going to be spent in the engine's editor. If you're using UE3, you'll be using their sound cue editor, kismet and level editor; if you're in id tech, you'll be using the level editor and notepad; some people actually use the ex component of fmod ex - it's going to be completely different depending on the game, target platforms and engine being used. So, it's only important to be technical enough and able to learn quickly since you're not going to really know what the tools and process are until your first day on the job.

Just be good with pro tools/soundforge/etc, understand enough of the math behind audio, learn how to use the engine/editor and understand enough scripting to be self sufficient and not bother programmers when you want a bunch of files renamed or something; that's all we really want out of a good sound designer.

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen
Yeah, speaking as an ex-game audio programmer, I think you need to be clearer about where your talents, passions and intentions lie.

If you don't already know how to program then coding your own custom music & sfx playback systems from scratch will be a large mountain to climb. Similarly, coding an audio system on top of FMOD or whatever is a lot of work if your intent is just to preview your sound design work in a "dress rehearsal" type environment; in that case you'd be better off just learning an existing game engine and assigning your sounds to new game objects.

As krysmopompas states, if you just want to be able to provide general audio pipeline & processing tools then basic scripting against existing utilities will suffice.

POKEMAN SAM
Jul 8, 2004

Rupert Buttermilk posted:

I'm a sound/music guy working on a mac. I really, really want to get into working with game developers in programming sound. What's my best approach? Should I learn programming, and if so, what language? Is there any way to test my work, say if I were working in something like FMOD? I have a bit of experience and understanding of Xact. I get how it works, and what sort of things it can do, albeit not completely.

I guess I mean that I'm stuck in a place where I want to help with/do sound programming, but I don't have anyone with a game that needs it, so how can I practice and hone my skills on my own?

My experience working as a programmer on a game audio tool is that you have two completely mutually exclusive choices: be an audio programmer and have no say into anything about the actual sound design, other than steering the sound designers towards using the features you want, or be a sound designer and have absolutely zero programming tasks (except maybe a scripting task or two) and be all about the sound. It sounds to me like you want to be a sound designer, and if so, you want to ready some portfolio pieces that you designed the sound for. For example, find some university student who does/did little 3d animations and fill it full of sound. When you get an interview knowing the tools of the trade will be secondary to having good examples of pieces you've designed the sound for.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Ugg boots posted:

For example, find some university student who does/did little 3d animations and fill it full of sound.

Please use the Wilhelm Scream whenever possible. :)

Rupert Buttermilk
Apr 15, 2007

🚣RowboatMan: ❄️Freezing time🕰️ is an old P.I. 🥧trick...

Thanks a ton for these responses. I really appreciate it.

ynohtna posted:

Yeah, speaking as an ex-game audio programmer, I think you need to be clearer about where your talents, passions and intentions lie.

Kelly Bailey (Valve) and Graham Norgate (Rare/Free Radical) - Those guys have the jobs I want. However, I see myself actually enjoying sound design much more than sound programming, but still interested in doing the programming side of things.

HolaMundo
Apr 22, 2004
uragay

sponge would own me in soccer :(
What's a good book/site/tutorial to learn opengl?
I know about nehe and heard about the red, blue and orange book but want some opinions on which are good or which book I should read first.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!
So I was thinking about putting together a simple 4x space game for the iPhone. Has anyone heard anything about Cocos2D-iPhone? It seems like a pretty standard graphics/audio/physics framework, but before I dive too deep into their docs, I'm curious if anyone has used it at all.

Digital Spaghetti
Jul 8, 2007
I never gave a reach-around to a spider monkey while reciting the Pledge of Alligence.
More of a general question than a specific one, but does anyone know *ANY* good resources for Android + OpenGL ES at all?

I've been googling for a couple of days now and coming up with nothing. If I was to be specific I'm looking for tutorial in relation to doing a 2D-side scroller with a Parallax background and sprite collision detection. Anything that is language agnostic too would be useful.

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen

Rupert Buttermilk posted:

Kelly Bailey (Valve) and Graham Norgate (Rare/Free Radical) - Those guys have the jobs I want. However, I see myself actually enjoying sound design much more than sound programming, but still interested in doing the programming side of things.

Gotcha.

Sounds like you should continue focusing on the sound design side of things but start picking up some general programming skills just centred around audio activities and thereby working towards adapting yourself towards your ideal job conditions. Be warned that learning to be a decent coder will take a lot of time and effort, and there will be many pitfalls, frustrations and red herrings along the way.

You could try picking some started coding texts in a C-dialect programming language. Then choose a suitable existing game engine and knocking up a small game (Pacman or whatever) but with a strong focus on producing a high-quality audio environment rather than graphical or gameplay features. Hell, if you engage your imagination enough you should be able to envisage a game or two that rely solely upon sound rather than graphics.

This should give effective experience in audio production pipelines, game-specific sound design, and the issues faced when integrating audio into existing game engine systems (attaching sfx to game objects, real-time music systems, spacial & frequency coordination, memory & latency issues, etc).

An additional suggestion that I make would be to keep your growing programming skills quiet until you are confident that you have the experience, skills and passion to promote yourself as a twofer. Quality sound designers are always useful, and additional tech and coding skills are a good bonus, particularly in smaller studios which may not have the resources to support a full-time sound dude. However, being a little flaky in either could cause you to be unfairly compared against general tools programmers who know how to grab & crop effects off sample CDs thereby reducing your credibility as a sound designer.

ynohtna fucked around with this message at 18:27 on Jun 15, 2009

Rupert Buttermilk
Apr 15, 2007

🚣RowboatMan: ❄️Freezing time🕰️ is an old P.I. 🥧trick...

Whoa! Thank you so much for this! Definitely appreciate, and I will take your advice.

Slurps Mad Rips
Jan 25, 2009

Bwaltow!

You could also take a look at ChucK

Music and programming. :)

Spite
Jul 27, 2001

Small chance of that...

HolaMundo posted:

What's a good book/site/tutorial to learn opengl?
I know about nehe and heard about the red, blue and orange book but want some opinions on which are good or which book I should read first.

It depends on what you know - if you know absolutely nothing about 3d graphics you need to start simple. Nehe is a good start, but a lot of their techniques are either out of date or naive. The Red Book is a good start (and you can find it online), the Blue Book is great and I find the Orange Book to be kind of meh. You'll need the Blue and Orange Books if you are going to be serious. A good reference in general is Real-Time Rendering, which covers lots of techniques and is written well.

Brush up on your linear algebra and make sure you understand matrix math. Understanding how the transforms work is key. Above all, practice. Nothing makes you better than writing a crapload of bad small apps.

FSMC
Apr 27, 2003
I love to live this lie
I want to make a texture atlas. My pictures are pngs with alpha, is there a tool which I can use to autogenerate a texture atlas? I want the final format to be png, but any lossless format will work.

Currently I'm using the nvidia tool but that compresses the textures first, so I think I'm losing some quality.

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen

SAHChandler posted:

You could also take a look at ChucK

Music and programming. :)

ChucK rocks - I've got a custom realtime grid sequencing and patch editing Emacs mode lying in my abandoned personal projects folder. However, it's high CPU burden (sample accurate realtime synthesis comes at a cost!) and "unique" language paradigms mean that it's not a skill transferrable to most real world situations. It can be a great source of squonks and digitextures that are sampled for later playback (like a 21st century CSound or Capybara) but good luck convincing any game programmers to integrate it into their engine!

Pointing it out as anything other than a subject of interest to someone looking to start coding fresh could be seen as slightly cruel, but it should be more mature - particularly in terms of updated documentation! - when Rupert is comfortable enough with coding to properly appreciate it. The mailing list currently has a high percentage of discussion on ways to overcome language problems, work around bugs, and implement higher-level organizational systems (voice allocators, timeouts, thread pools, clock synchronization, etc) necessary to build non-noddy performance synthesis setups. Whilst it's definitely cool, it does have the obvious disadvantages of being developed part-time by some Princeton academics.

Eh, lookit me nerding out about sound programming. :downs:

Scarboy
Jan 31, 2001

Good Luck!

Unparagoned posted:

I want to make a texture atlas. My pictures are pngs with alpha, is there a tool which I can use to autogenerate a texture atlas? I want the final format to be png, but any lossless format will work.

Currently I'm using the nvidia tool but that compresses the textures first, so I think I'm losing some quality.

I use ruby + imagemagick, my scripts look like this:

code:
require 'rubygems'
require 'RMagick'
include Magick

atlus = ImageList.new
atlus.new_image(512, 512) { self.background_color = "none" }

atlusimages = ImageList.new("Arrow-Left.png", "Arrow-Right.png", "Easy.png", "Normal.png", "Hard.png", "Stage.png", "Grey.png", "Clear.png", "Selector.png", "Stage-Select.png", "Bomb-Black.png", "Bomb-Red.png")

atlus.composite!(atlusimages[0], 0, 0, OverCompositeOp) #25x133 Arrow-Left.png
atlus.composite!(atlusimages[1], 25, 0, OverCompositeOp) #24x133 Arrow-Right.png

atlus.composite!(atlusimages[2], 49, 0, OverCompositeOp) #154x53 Easy.png
atlus.composite!(atlusimages[3], 49, 53, OverCompositeOp) #154x53 Normal.png
atlus.composite!(atlusimages[4], 49, 106, OverCompositeOp) #154x53 Hard.png

atlus.composite!(atlusimages[5], 203, 0, OverCompositeOp) #96x96 Stage.png (Level Frame)
atlus.composite!(atlusimages[6], 203, 96, OverCompositeOp) #96x96 Grey.png (Cleared Level Frame)
atlus.composite!(atlusimages[7], 299, 0, OverCompositeOp) #96x96 Clear.png (Cleared Level Text)
atlus.composite!(atlusimages[8], 299, 96, OverCompositeOp) #96x96 Selector.png (Level cursor)

atlus.composite!(atlusimages[9], 0, 159, OverCompositeOp) #175x39 Stage-Select.png

atlus.composite!(atlusimages[10], 0, 198, OverCompositeOp) #31x30 Bomb off
atlus.composite!(atlusimages[11], 31, 198, OverCompositeOp) #31x30 Bomb on

atlus.write("png:extras.png")
Comes out perfect and I have the exact coordinates of my image in the atlus on hand!

HolaMundo
Apr 22, 2004
uragay

sponge would own me in soccer :(

Spite posted:

It depends on what you know - if you know absolutely nothing about 3d graphics you need to start simple. Nehe is a good start, but a lot of their techniques are either out of date or naive. The Red Book is a good start (and you can find it online), the Blue Book is great and I find the Orange Book to be kind of meh. You'll need the Blue and Orange Books if you are going to be serious. A good reference in general is Real-Time Rendering, which covers lots of techniques and is written well.

Brush up on your linear algebra and make sure you understand matrix math. Understanding how the transforms work is key. Above all, practice. Nothing makes you better than writing a crapload of bad small apps.

Thanks for the reply :)
I'll start with the red book and nehe then, guess I'll also read about linear algebra to refresh my memory.

POKEMAN SAM
Jul 8, 2004
Here's a good paper on how to automatically pack textures into a larger texture, too, while we're on the subject of texture atlases: http://www.blackpawn.com/texts/lightmaps/default.html

PnP Bios
Oct 24, 2005
optional; no images are allowed, only text
If you want to do stuff in .NET but don't like XNA for whatever reason, and can't stand Tao.NET, there is OpenTK, which is a quite nice light weight toolkit.

http://www.opentk.com/

This one is nice because it's actively being developed. It also works hard to be more than just a managed API wrapper. Works great in mono and .net!

POKEMAN SAM
Jul 8, 2004

PnP Bios posted:

If you want to do stuff in .NET but don't like XNA for whatever reason, and can't stand Tao.NET, there is OpenTK, which is a quite nice light weight toolkit.

http://www.opentk.com/

This one is nice because it's actively being developed. It also works hard to be more than just a managed API wrapper. Works great in mono and .net!

If you just want the DirectX wrappings, there's SlimDX, too.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!
Anyone know of any tools that would let me load up a sprite/animation, draw a polygon over it, and export the vertices? We're at the stage where we are importing content into our engine, and we are going to need lots and lots of physics polygons drawn for our sprites, and we're looking to speed up this process a bit. We could write our own tool, but we figured that this problem has probably already been solved hundreds of times. We also considered using marching squares to build our polygons for us, but were worried the results would either have too many/few vertices (or take too long to code) for our purposes. We're using Box2D as our physics back end, and I've scoured their forums for a similar tool with little luck.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Do you really need perfect accuracy for this? You'd have to provide more details, but you can fudge stuff quite a bit, and you might even be able to stick with AABBs for most objects. If that's not enough (and I'd suggest you test the behaviour with AABBs before you do anything else), a quick-and-dirty solution might give good-enough results.

There's also the comedy "import sprite data into Illustrator and vectorize it in there" option.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

Avenging Dentist posted:

Do you really need perfect accuracy for this? You'd have to provide more details, but you can fudge stuff quite a bit, and you might even be able to stick with AABBs for most objects. If that's not enough (and I'd suggest you test the behaviour with AABBs before you do anything else), a quick-and-dirty solution might give good-enough results.

There's also the comedy "import sprite data into Illustrator and vectorize it in there" option.

Unfortunately we are using space ships with somewhat unusual contours. We've tested both AABB and circle based solutions, but as physics is a core component of the gameplay (lots of tugboat style maneuvers), we need slightly more accuracy. Honestly, in most cases, we could make due with 8-12 points (and in some cases fewer.) We've been doing them by hand by opening the image in photoshop, and clicking around to get our point list, but that's tedious in the extreme.

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen

Pfhreak posted:

Unfortunately we are using space ships with somewhat unusual contours. We've tested both AABB and circle based solutions, but as physics is a core component of the gameplay (lots of tugboat style maneuvers), we need slightly more accuracy. Honestly, in most cases, we could make due with 8-12 points (and in some cases fewer.) We've been doing them by hand by opening the image in photoshop, and clicking around to get our point list, but that's tedious in the extreme.
You could write a Photoshop plug-in that exports a path's points.

One of my team has coded something similar (exporting layer boundary offsets as XML) this afternoon as a skunkworks tool for our current project so it can't be too hard.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!
Actually, after playing with marching squares today, I've managed to postprocess my list of vertices down from several thousand to a few dozen without much thinking. Once I put some thought into intelligently removing points, this should be no problem.

Edit: Got it, went from 1000+ points into the 18 (or thereabouts) most representative points. It only does one object per image right now, but this is going to save so much time. For example this (1092 points):



Became:


(Can't really see the spots in this image)

My Approach:
Use the standard 'marching squares' algorithm to build a list of x,y coordinates at one pixel apart. If the algorithm would place two points going the same direction (two 'UP' points in a row) don't place a new point in the list, just keep travelling until the direction changed. (This alone reduced my point list by nearly half.)

The next step was to iterate through the list and remove any point that was either too close to its neighbors, or had a low angle. Suppose points A,B,C were in this list, and the angle between A and B was 10 degrees, and the angle between B and C was 12 degrees. In that case I just removed B, and got a reasonable approximation of the shape. This algorithm turned out to be a decent first stab, but it doesn't work perfectly. (Ie, given a square, it would not spit out exactly 4 points, maybe 6 or 8.)

Then, I wrote a wrapper that slowly relaxed the tolerances and reran the post processing algorithm on the remaining points. Obviously, some fidelity is lost in the shape of the object, but that's sort of the point, right? It actually held together pretty decently down to around 6 points for that complex shape above.

I'd say it worked pretty well. Also, apologies for using this thread as a sounding board. Sometimes it helps me to think through a problem if I have to sit down and actually explain what the possible approaches are, and what courses of action I might take.

Pfhreak fucked around with this message at 00:35 on Jun 18, 2009

FSMC
Apr 27, 2003
I love to live this lie
I started writing the AI, now I've started done some movement animations. I've had some problems putting movement together with the animations for a person but found a way.
Now for the AI the only way I can think of putting the two together is a bit messy.

I've got a function which runs all the AI choices. But the problem I have atm, is that say the AI wants to move then attack a unit. The move takes time due to the animation.

The only solution I have is to make a function that runs every frame, and in this function it checks conditions, and uses lots of conditions to see what has been done, and what needs to be done.

code:
//currently or style I would like
-(void)runAI
{
[self moveUnit];
[self attackWithUnit];
}

//my possible solution

-(void)setAIParam
{
move=1;
moved=0;
attack=1;
}

//the anim part sets moved=1 when animation has finished.

-(void)runEveryFrame
{
if(move=1)
{
[self moveUnit];
}

if(attack=1 && moved==1)
{
[self attackWithUnit];
}
}
Is there a better way?

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Since you haven't actually specified how your game plays (turn-based? real-time?) you're probably not going to get much useful info. For real-time games you probably shouldn't be statically defining the behavior very far in advance. Make it play like a real player: it has a list of objectives and each frame will do the action that it believes will help it achieve one or more of those objectives.

For turn-based games where you do multiple things per turn you could just have a callback when a given animation stops playing (this has the benefit that you can implement a "skip" function in your animator that will skip to the next action and everything will just magically work).

Pope Ron Paul II
Feb 10, 2008
GodTube Ron Paul?
I've just joined in, and just finished scanning the other pages. But I'm really dumb when it comes to programming language and knowing what to look for with my question, so forgive me if this has been answered already in some way, shape, or form.

I want to learn how to write a texture. To give you some specifics about what I am looking to do is improve some of the grassland, water, stone, and woodland textures in a game called Stronghold. I'm not sure how familiar you are with it or not, but it's a medieval real-time-strategy game. Here's a screenshot with the graphics I'm dealing with.

Click here for the full 1024x768 image.


I essentially want to improve them since they're fairly low quality textures, but I have no idea how. All I can tell you is that all of the graphical files are in .gfx file extension. Is there any way I can learn to do this? What programs will I need?

Pope Ron Paul II fucked around with this message at 23:10 on Jun 22, 2009

ahobday
Apr 19, 2007

Pope Ron Paul II posted:

I've just joined in, and just finished scanning the other pages. But I'm really dumb when it comes to programming language and knowing what to look for with my question, so forgive me if this has been answered already in some way, shape, or form.

I want to learn how to write a texture. To give you some specifics about what I am looking to do is improve some of the grassland, water, stone, and woodland textures in a game called Stronghold. I'm not sure how familiar you are with it or not, but it's a medieval real-time-strategy game. Here's a screenshot with the graphics I'm dealing with.

Click here for the full 1024x768 image.


I essentially want to improve them since they're fairly low quality textures, but I have no idea how. All I can tell you is that all of the graphical files are in .gfx file extension. Is there any way I can learn to do this? What programs will I need?

Just throwing out some common sense questions here. You say "write" a texture, but I'm pretty sure, unless they're doing some different here, that you'll be drawing the new textures. They're usually in an image format.

The .gfx format they've got going might not be popular enough or "too" proprietary to have some kind of tool that can extract the data from inside it. Or it might not be an archive format, and might be some binary format they've written specifically for the game. So it might be hard to get in there at the texture files to change.

I know nothing about this game, but as I said, this is just some common sense stuff.

Try looking to see if there's a modding community?

FSMC
Apr 27, 2003
I love to live this lie

Avenging Dentist posted:

Since you haven't actually specified how your game plays (turn-based? real-time?) you're probably not going to get much useful info. For real-time games you probably shouldn't be statically defining the behavior very far in advance. Make it play like a real player: it has a list of objectives and each frame will do the action that it believes will help it achieve one or more of those objectives.

For turn-based games where you do multiple things per turn you could just have a callback when a given animation stops playing (this has the benefit that you can implement a "skip" function in your animator that will skip to the next action and everything will just magically work).

It's a turn based game. I looked up callback and it looks like a great solution to the problem I gave, but I've since realised the overall problem is a bit more complicated. I have a function which tells every unit if it should move, attack, build a base, etc.

So I have lots of functions, with lots of variables. Is there a way to to use callbacks or something else for a longer list of things to do?

code:
//each function must wait until the animation the previous function calls is complete.
functA(int a, int b);
if(x) functB(int, e, float c, point d);
functC(int pos, int index, int t);
...

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Just chain the callbacks together. Or implement a queue of actions for each turn. Basically:

code:
struct Action
{
    virtual void act() = 0;
    virtual void animate() = 0;
};

struct BuildAction
{
    BuildAction(int type,vec2d position);
    void act()
    {
        // build a structure
    }
};

std::queue<Action*> action_queue;

// ...

action_queue.push(new MoveAction(position1));
action_queue.push(new BuildAction(TOWER,position2));

// ...

while(!action_queue.empty())
{
    action_queue.front()->act();
    action_queue.front()->animate(); // this may take a few seconds
    delete action_queue.front();
    action_queue.pop();
}

Pope Ron Paul II
Feb 10, 2008
GodTube Ron Paul?

Centipeed posted:

Just throwing out some common sense..

The .gfx format they've got going might not be popular enough or "too" proprietary to have some kind of tool that can extract the data from inside it. Or it might not be an archive format, and might be some binary format they've written specifically for the game. So it might be hard to get in there at the texture files to change.

I know nothing about this game, but as I said, this is just some common sense stuff.

Try looking to see if there's a modding community?

I already have. Almost nothing in that regard exists for this game. I would have to ask as a special request if someone on a forum like that would be willing to do it for me. I highly doubt someone else would take time out of their day on my behalf for such an old game. And in response to not making sense, I know nothing about this sort of thing so forgive me.

It looks like it isn't possible or worth it for me, especially because I have the drawing skills of a chicken.

ahobday
Apr 19, 2007

Pope Ron Paul II posted:

I already have. Almost nothing in that regard exists for this game. I would have to ask as a special request if someone on a forum like that would be willing to do it for me. I highly doubt someone else would take time out of their day on my behalf for such an old game. And in response to not making sense, I know nothing about this sort of thing so forgive me.

It looks like it isn't possible or worth it for me, especially because I have the drawing skills of a chicken.

This might help you?

http://stronghold.heavengames.com/downloads/showfile.php?fileid=4474

Then again, if you've searched around for this so far, you might have already found it.

Adbot
ADBOT LOVES YOU

Pope Ron Paul II
Feb 10, 2008
GodTube Ron Paul?

Centipeed posted:

This might help you?

http://stronghold.heavengames.com/downloads/showfile.php?fileid=4474

Then again, if you've searched around for this so far, you might have already found it.

Actually, I haven't. I found that particular forum, but I didn't find that mod or program he's using. Thanks for finding it! It's worth a shot. I have no guarantee that the animations for things like water or waving trees will work, but I'll try. I might post results if I get it to work the way I like.

Just a worry I have. If I use this and edit the grasslands for example, I'm worried that it might not look like a contiguous field: that it might look choppy because of where the square for the basic 1x1 texture picture ends.

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