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
Tasty and Delicious
Jun 2, 2009

by Y Kant Ozma Post
What kind of questions would you ask a potential employer? I'm currently thinking of switching from a non-game related programming job to be a game graphics programmer. I haven't received a formal offer yet but I'm expecting a small pay cut and less benefits than I currently have. I have weirdo anxieties about switching, so any advice on how to assure myself would be nice.

Tasty and Delicious fucked around with this message at 18:04 on Dec 16, 2009

Adbot
ADBOT LOVES YOU

Vinterstum
Jul 30, 2003

Tasty and Delicious posted:

What kind of questions would ask a potential employer? I'm currently thinking of switching from a non-game related programming job to be a game graphics programmer. I haven't received a formal offer yet but I'm expecting a small pay cut and less benefits than I currently have. I have weirdo anxieties about switching, so any advice on how to assure myself would be nice.

What questions you should ask a potential employer, or the other way around? :)

If the first: Beyond the usual benefits, ask about their policy regarding crunch and how long they usually end up doing it for a given project.

And you could always hit up Mobygames, check the credit lists for the company's previous games, and ask around a bit...

ehnus
Apr 16, 2003

Now you're thinking with portals!
I'd also ask what kind of VCS they use just to make sure that you don't get stuck working with Source Safe.

I'd also ask how long their average build iteration is (ie: from making a change to deployment). I've worked in environments where teams had a 15 minute incremental build time and it was unbearable to work in, there's no way I would ever subject myself to that ever again.

I'd also ask how long people work at the company on average because I figure that if a company has fairly low turnover then other employees must think of it as a good place to work.

Alex007
Jul 8, 2004

What is a good place online to sell complete projects ?

Quarantine 2019 started as a goon project (a zombie MMO I started because I got sick of Urban Dead) and is now pretty popular and appreciated by the players, and generates about 200$/months in ads. But real life is keeping me away from the PC more and more and I can'T take good enough care of the project. I could just drop it but I'd prefer to sell it since people are enjoying it a lot it seems.

I'm selling everything, code, data, forum, domains, etc. It is a complete project already running and has all the momentum it needs.

Where would I go to sell such project ? It has been coded in PHP and is 100% mine, not based on a game framework and no code borrowed from elsewhere.

Evil Trout
Nov 16, 2004

The evilest trout of them all

Alex007 posted:

What is a good place online to sell complete projects ?

Quarantine 2019 started as a goon project (a zombie MMO I started because I got sick of Urban Dead) and is now pretty popular and appreciated by the players, and generates about 200$/months in ads. But real life is keeping me away from the PC more and more and I can'T take good enough care of the project. I could just drop it but I'd prefer to sell it since people are enjoying it a lot it seems.

I'm selling everything, code, data, forum, domains, etc. It is a complete project already running and has all the momentum it needs.

Where would I go to sell such project ? It has been coded in PHP and is 100% mine, not based on a game framework and no code borrowed from elsewhere.

I sent you a PM about this. I run Forumwarz.com which is moderately popular (over 200k accounts.)

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Walorski posted:

poo poo. Unless that's sarcasm, I'll go back to playing with Blender 'til I know how to program. I was asking because I didn't know how much you needed to know to make game mods.
We're at a point right now where I wouldn't say any popular game is terribly easy to mod.

I'd disagree with what other posters have said and ENCOURAGE you to aim for projects that may be too big to handle. Want to try making a Crysis clone as your first game? Great, go nuts. Taking on challenges and learning things you don't currently know is how you'll advance, and you won't do that if you stay in your comfort zone. Just don't expect a blockbuster, a successful product, or even a finished one right off the bat.

(On a similar note, taking risks and not being afraid to make a failed product is the only way you'll ever make a successful one anyway)

OneEightHundred fucked around with this message at 18:16 on Dec 17, 2009

guenter
Dec 24, 2003
All I want out of life is to be a monkey of moderate intelligence who wears a suit. That's why I've decided to transfer to business school!
I've long been messing around with a simple top down space shooter and the AI is probably the most difficult things I've had to deal with. Most of the problem is the control scheme I've selected. You can either rotate or accelerate in your current direction. It's semi-realistic in that you'll keep rotating or drifting until you apply forces to stop yourself. There's some magic space drag and max speeds in place but that's not really important.

The most promising way I've found of going about the AI would be something like craig reynolds steering behaviors. The problem with those is that they seem to expect you're dealing with actors who can accelerate and rotate instantaneously.

My other attempts focused around selecting behaviors and stepping the simulation to evaluate them with heuristics but once I had to start simulating the collision system for obstacle avoidance it got slow and unwieldy.

Has anyone had any experience applying them to something like this? Or have altenative suggestions?

Star Warrior X
Jul 14, 2004

Rather than having the AI try to pathfind around obstacles, have them just try to not crash into obstacles, while still moving as much as possible towards their goal. Remember, they do not need to choose the best path, as long as they get there.

Triarii
Jun 14, 2003

Maybe your situation is more complex, but when I've implemented things that don't turn instantaneously, I just keep separate "targetAngle" and "currentAngle" values for each actor. The steering behavior gets applied to the targetAngle, instantly changing to it face the desired direction, and then the actor continuously (and gradually) adjusts its currentAngle towards the targetAngle. When the current angle is equal to the target angle (or within fifteen or thirty degrees of it or whatever), accelerate; when it's not, decelerate.

guenter
Dec 24, 2003
All I want out of life is to be a monkey of moderate intelligence who wears a suit. That's why I've decided to transfer to business school!

Mayakashi posted:

Maybe your situation is more complex, but when I've implemented things that don't turn instantaneously, I just keep separate "targetAngle" and "currentAngle" values for each actor. The steering behavior gets applied to the targetAngle, instantly changing to it face the desired direction, and then the actor continuously (and gradually) adjusts its currentAngle towards the targetAngle. When the current angle is equal to the target angle (or within fifteen or thirty degrees of it or whatever), accelerate; when it's not, decelerate.

That was one of my first approaches but I usually ended up just orbiting around my targets since the ships momentum would constantly invalidate my target heading. If you'll indulge my terrible mspaint:



The light triangle is the ship moving along the blue vector when it decides it needs to get to the red dot target. So it's target heading is the black vector. To get that heading the quickest it needs to accelerate along the direction of the light blue vector. That's all fine and eventually it reaches it's target heading, but by the time it does the position of the ship is now something like where the dark green triangle is and it immediately needs a new goal heading.

Around this time I gave up and started looking at heuristics and stuff =/

Triarii
Jun 14, 2003

You'll want to recalculate the target heading every frame, because yeah, you're basically aiming for a moving target (relative to the ship). Also note my suggestion to decelerate when your current heading is more than a certain distance in degrees from the target heading; that should help with orbiting issues, giving you rapidly decaying orbits at worst. If your ships can't afford to orbit or overshoot at all (like if they're docking with a space station), you could additionally check the distance to your target each frame and slow down once you're close to it.

I don't claim to have explored all possible ways to do this, so this might not be the best way to go about it, but this is what I've learned from my experience.

haveblue
Aug 15, 2005



Toilet Rascal

guenter posted:

Around this time I gave up and started looking at heuristics and stuff =/

What we're doing to pretty good effect to solve the orbiting problem:

-Calculate the turning radius of the ship at the current speed
-Multiply this distance by the sine of the relative angle of the target (this approximates the length of the chord from the ship's initial position to where it would be in its trajectory if it underwent a turn to the target heading)
-If the distance to the target is smaller than this value, the ship is going to overshoot despite turning so reduce speed.

This makes the ship spiral in on the target; its final orientation can be anything but it usually stops on a dime where directed. I'd need to draw a diagram to properly justify this but it seems to work well enough.

haveblue fucked around with this message at 23:33 on Dec 21, 2009

guenter
Dec 24, 2003
All I want out of life is to be a monkey of moderate intelligence who wears a suit. That's why I've decided to transfer to business school!

Mayakashi posted:

You'll want to recalculate the target heading every frame, because yeah, you're basically aiming for a moving target (relative to the ship). Also note my suggestion to decelerate when your current heading is more than a certain distance in degrees from the target heading; that should help with orbiting issues, giving you rapidly decaying orbits at worst. If your ships can't afford to orbit or overshoot at all (like if they're docking with a space station), you could additionally check the distance to your target each frame and slow down once you're close to it.

I don't claim to have explored all possible ways to do this, so this might not be the best way to go about it, but this is what I've learned from my experience.

I'll give decelerating a shot and see if that smooths out some of the problems. Decelerating is actually another problem in itself since right now you can only apply force in the direction of (and opposite) your heading. Maybe I'll just add the ability to strafe. Fun, fun, fun!

Framing the problem as hitting a moving target is interesting too, I'd never really considered it as such. In that back of my mind I'd been thinking how much more complicated things will be when I'm trying to do pursuit behaviors or something but really it's the same problem. I could just add my target's velocity to my ship or something. Thanks!

Triarii
Jun 14, 2003

guenter posted:

I'll give decelerating a shot and see if that smooths out some of the problems. Decelerating is actually another problem in itself since right now you can only apply force in the direction of (and opposite) your heading. Maybe I'll just add the ability to strafe. Fun, fun, fun!

Ah, I hadn't considered that spaceships tend to only have engines facing one direction :downs: That would make things a bit trickier. Still, I think the general approach of "turn towards target heading, accelerate if current heading is (almost) equal to it" is at least a good place to start.

Also, if these targets you're moving towards happen to be waypoints in a path, another tip is to make the "points" actually a circle with a smallish radius, such that each ship will consider itself to have hit the waypoint if it gets within a certain distance of it (rather than passing directly through it). That'll let ships careen around the play area without having to be so precise in their movements, making for easier programming and possibly more natural-looking motion.

Edit: Now that I think about it, you don't really want to turn to face directly at the target; you want to aim to compensate for your current velocity. So if you're speeding past the target like this:



You really want to aim somewhere like here:



I'm not sure how to find that point off the top of my head. Maybe add the negative of the component of your velocity perpendicular to the line between you and the target?

Triarii fucked around with this message at 01:19 on Dec 22, 2009

whorfin
Dec 6, 2007

Vinterstum posted:

What questions you should ask a potential employer, or the other way around? :)

If the first: Beyond the usual benefits, ask about their policy regarding crunch and how long they usually end up doing it for a given project.

And you could always hit up Mobygames, check the credit lists for the company's previous games, and ask around a bit...


I like to ask what their process is. Are they Agile, Waterfall, something else? How are milestones broken up? Do they use strike teams or Valve style cabals, or are the disciplines seperated? How does code and system ownership work at the studio? How involved are non-designers in the design process? What's the turnover rate of the studio? What sort of documentation is maintained? Do programmers work from formalized approved GDD's, or is it the wild west?

Fecotourist
Nov 1, 2008
If it's just pursuit you're after, try proportional navigation. The math is pretty simple. Basically you use an acceleration that's always perpendicular to your velocity and proportional to the angular velocity of the target. Perpendicular means that your velocity stays constant by default.
http://en.wikipedia.org/wiki/Proportional_navigation

Vietnom nom nom
Oct 24, 2000
Forum Veteran
I'm currently working on a project in a Lua based framework (my first time working with Lua), and I'm starting to push the performance envelope in some of the edge cases of the program. There's plenty of optimization still to do, but I'd feel more comfortable about moving forward if I knew I had a viable fallback option in the Lua C API for various critical functions within my program.

Basically, at an extreme, I could possibly have 3000 objects (tables obviously within Lua), each with a table containing 3000 further tables, amongst other smaller pieces of data.

So updating the data within those "sub"-tables means iterating over 3000x3000=9 million tables potentially. The updates themselves would likely be quick, changing a single variable or two.

The game is turn based, so updates are not going to have to occur over a single frame or anything absurd like that, 5-10 seconds would be acceptable. My question is, would crossing over the Lua/C barrier and doing just the one or two functions that affect those large datasets give me substantial speedup? Or would setting up the data via the Lua C API ultimately cost me more than it would gain for such a limited function set?

Bizarro Buddha
Feb 11, 2007
Two things come to mind:

1) What kind are you doing that needs this much nested data? Each object referencing another 3000 objects seems like a hell of a lot.

2) Rather than looking at a speedup by switching to C code you should be looking at using a different data structure with less than linear lookup time. The latter will be a much bigger gain than the former. I couldn't tell you what structure you'd want to use without knowing more about your data, but if it can be ordered then a binary search tree might be a good start. And if your data can be roughly categorised you can use bucketing to cut down on the search space.

No Safe Word
Feb 26, 2005

Very interesting slideware from Valve on their AI/Procedural Generation stuff in Left 4 Dead that they released on the Team Fortress blog today:

http://www.valvesoftware.com/publications/2009/ai_systems_of_l4d_mike_booth.pdf

Vietnom nom nom
Oct 24, 2000
Forum Veteran

Bizarro Buddha posted:

1) What kind are you doing that needs this much nested data? Each object referencing another 3000 objects seems like a hell of a lot.

I'll give a generic answer of sorts to keep it simple. Imagine a world of 3000 people, each of those people have a set of attributes. Every person knows every other person, but they all know varying numbers of each others attributes. Example:

John & Bob both know Jane likes the color red.

Every person has a table titled "knowledge" that is filled with 2999 sub-tables that list what attributes they know for each other person. So John & Bob have a "knowledge" sub-table titled "Jane" that lists "likes color red".

Every turn, everyones attributes could change. So in my example, Jane decides one day that she also likes cats as pets. Since John is particularly perceptive, he now knows that Jane likes pets, but since Bob isn't as perceptive, he doesn't learn of this new information.

John's "knowledge.Jane" table gets updated, Bob's doesn't.

quote:

2) Rather than looking at a speedup by switching to C code you should be looking at using a different data structure with less than linear lookup time. The latter will be a much bigger gain than the former. I couldn't tell you what structure you'd want to use without knowing more about your data, but if it can be ordered then a binary search tree might be a good start. And if your data can be roughly categorised you can use bucketing to cut down on the search space.

There are certainly some optimizations I can and will do (not to mention some I've already done). But ultimately I want to know how far I can push things as far as expanding the data sets involved further. I was just wondering if anyone who has used the Lua C API had any input as to what kind of performance gain is realistic for iterating over large numbers of Lua tables.

Vietnom nom nom fucked around with this message at 10:29 on Dec 22, 2009

Tasty and Delicious
Jun 2, 2009

by Y Kant Ozma Post

whorfin posted:

I like to ask what their process is. Are they Agile, Waterfall, something else? How are milestones broken up? Do they use strike teams or Valve style cabals, or are the disciplines seperated? How does code and system ownership work at the studio? How involved are non-designers in the design process? What's the turnover rate of the studio? What sort of documentation is maintained? Do programmers work from formalized approved GDD's, or is it the wild west?

My last four developer jobs were all "wild west" where I had a fair amount of autonomy and I'm expecting a good amount in this new one so I don't expect process to get in the way too much. What would be deal breakers for you? If the position was what you're looking for, out of curiousity what would make you not take the job assuming pay was adequate?

Anyway, I took the job! I had a difficult time thinking of deal breakers so I figured I might as well go with it. Many thanks to the people who replied.

Tasty and Delicious
Jun 2, 2009

by Y Kant Ozma Post

Krackbaby posted:

I'll give a generic answer of sorts to keep it simple. Imagine a world of 3000 people, each of those people have a set of attributes. Every person knows every other person, but they all know varying numbers of each others attributes. Example:

John & Bob both know Jane likes the color red.

Every person has a table titled "knowledge" that is filled with 2999 sub-tables that list what attributes they know for each other person. So John & Bob have a "knowledge" sub-table titled "Jane" that lists "likes color red".

Every turn, everyones attributes could change. So in my example, Jane decides one day that she also likes cats as pets. Since John is particularly perceptive, he now knows that Jane likes pets, but since Bob isn't as perceptive, he doesn't learn of this new information.

John's "knowledge.Jane" table gets updated, Bob's doesn't.


There are certainly some optimizations I can and will do (not to mention some I've already done). But ultimately I want to know how far I can push things as far as expanding the data sets involved further. I was just wondering if anyone who has used the Lua C API had any input as to what kind of performance gain is realistic for iterating over large numbers of Lua tables.

Well 9 million updates is going to be massive no matter how you cut it right? It sounds like you're dealing with a sparse matrix though so a 3000x3000 grid sounds like a bad data structure to use.

For a real answer, unless your C function is doing something intrinsicly different like using SSE instructions or you're exceptionally good at C optimizations, you probably won't see a huge perf boost. Context switches aren't free and the lua implementation is written intelligently.

whorfin
Dec 6, 2007

Tasty and Delicious posted:

What would be deal breakers for you? If the position was what you're looking for, out of curiousity what would make you not take the job assuming pay was adequate?

The specific answers to the questions I mentioned asking them aren't really what I'm looking for by asking them. I'm more interested in how their answered, and any internal issues it may bring up. "How does code ownership work here?" is a great way to find out if the lead is a micromanager. "What's the process, are you agile?" is a way to find out how much time you'll be spending filling out project tracking tools or attending meetings (which can be a terrible useless thing when done wrong, or can be the savior of the project and the only way making the game is even possible when done correctly), or if the project is a disorganized mess where you'll be wondering what to do half the time. Etc, etc. Which answers and good and which are bad really depend on the product. Eight people on the team? Agile is a waste of time. Two hundred people? God, I hope you're agile. At least, in my opinion.

If I was looking out of choice (ie, I was already employed, but looking around), and not necessity, then I'd be looking to see if whatever method they were using was working. Are conditions terrible? Is it a death march of crunch until the project ships and fails, or is canned and the team laid off? Or is there passion in the right people for the project? Not everyone has to love it, but it's important that certain people do. I can work on a game I have no interest in ever playing, but I don't think designers should have that luxury, for instance. Or the project lead (whether that person is called a director or a visionary or whatever). I want to make sure they have a clear and definite idea of the what the product is, so it's not going to be back at the drawing board every six months while they try to figure out why it's no fun.

I also want to know how much oversight there is from the money. I've taken jobs where I was assured the "angel investor" was going to be completely hands off, only to have the investor secretly assembling a team of ex-database programmers he had from his last venture to write our core platform tech in a second studio hundreds of miles away from where we were writing the game, and then drop in himself every three or four months demanding radical changes. The leads need to be strong enough people to stand up to the money, whether it's an angel investor, or a producer from a publisher they're partnered with, or even an internal producer when you're a part of a giant publisher yourself. I want a firm hand at the wheel.

It's not like any one thing is a dealbreaker for me, it's more like a collection of things I want to watch out, after having things go poorly in the past. Too many of those warning signs mean it's usually best to stay away.

On the other hand, I rarely submit resumes if it's not already a position I know I'd accept if they made an offer. It's a small industry, and after a couple years in it, you wind up knowing people everywhere, so getting the inside scoop on whether a place is worth checking out or not isn't too difficult.

Tasty and Delicious posted:

Anyway, I took the job! I had a difficult time thinking of deal breakers so I figured I might as well go with it. Many thanks to the people who replied.

Congrats, that's awesome!

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

Krackbaby posted:

I'll give a generic answer of sorts to keep it simple. Imagine a world of 3000 people, each of those people have a set of attributes. Every person knows every other person, but they all know varying numbers of each others attributes. Example:

John & Bob both know Jane likes the color red.

Every person has a table titled "knowledge" that is filled with 2999 sub-tables that list what attributes they know for each other person. So John & Bob have a "knowledge" sub-table titled "Jane" that lists "likes color red".

Every turn, everyones attributes could change. So in my example, Jane decides one day that she also likes cats as pets. Since John is particularly perceptive, he now knows that Jane likes pets, but since Bob isn't as perceptive, he doesn't learn of this new information.

John's "knowledge.Jane" table gets updated, Bob's doesn't.


There are certainly some optimizations I can and will do (not to mention some I've already done). But ultimately I want to know how far I can push things as far as expanding the data sets involved further. I was just wondering if anyone who has used the Lua C API had any input as to what kind of performance gain is realistic for iterating over large numbers of Lua tables.

You either need to change the problem or change your solution, based on the info you gave I'm not really sure which it is.

If you really have a worst case situation where every single entity can update every single sub-entry, then you can't beat O(n^2) in the worst case. You are stuck with a huge rear end iteration. Switching into C might buy you some speed improvements, but my guess is they won't be drastic.

However, there's no reason you should be doing an O(n^2) iteration in the average case. My guess is that this could be done in O(nlogn) (roughly 35,000 compares, a savings of 99.6%). If you were clever with dynamic programming, kept everything properly sorted, or I knew more about the problem domain, there's a reasonable chance that you could do it with fewer than that.

So my recommendation is to evaluate your algorithm before you start trying to get tricky by switching to C.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
What you probably want is a hierarchical AI system. In other words, rather than 3000 independently acting objects, break them into groups of objects, and groups of those groups, etc.

Intelligence travels up tiers, orders travel down.

Morpheus
Apr 18, 2008

My favourite little monsters
So I'm tinkering with this simple roguelike I've slowly been adding to, and I've decided that, while the current line of sight algorithm of using the Bresenham Line Algorithm and shooting it everywhere to see what I can, I really should think about better ways. So I've tried to use recursive shadowcasting.

And tried.

And tried.

And tr- you get the point. I can't do it for some reason. Things just...go wrong. Slopes between two points that should be negative aren't, every tutorial I find does things differently (and for some reason some define slope as (x2-x1)/(y2-y1)), and for every step forward I make, something else goes wrong. Just getting a single octant to work is getting me to pull my hair out.

The worst thing is that while I don't technically need this for line of sight, what I really want to do is use it to implement lighting that doesn't slow things down to a crawl.

Has anyone used this before, and knows what kind of problems I'm talking about? I've been following this tutorial as well as following this, but neither seems to work and I can't quite figure out why.

Edit: Wait I think I figured out the problem, just not the solution. The problem lies, mostly, within the tutorial I was reading where they explain that the slope of a line leading from the origin (top left) to a source of sight (ie the player) has a slope of -1. It does, but only if the player is transformed to be the origin, and everything has polar coordinates related to it. Otherwise the slope is positive. So now I just need to figure out some wonky slope and octant and transformations and ugh my brain hurts.

Morpheus fucked around with this message at 01:08 on Dec 30, 2009

UberJumper
May 20, 2007
woop

Morpheus posted:

So I'm tinkering with this simple roguelike I've slowly been adding to, and I've decided that, while the current line of sight algorithm of using the Bresenham Line Algorithm and shooting it everywhere to see what I can, I really should think about better ways. So I've tried to use recursive shadowcasting.

And tried.

And tried.

And tr- you get the point. I can't do it for some reason. Things just...go wrong. Slopes between two points that should be negative aren't, every tutorial I find does things differently (and for some reason some define slope as (x2-x1)/(y2-y1)), and for every step forward I make, something else goes wrong. Just getting a single octant to work is getting me to pull my hair out.

The worst thing is that while I don't technically need this for line of sight, what I really want to do is use it to implement lighting that doesn't slow things down to a crawl.

Has anyone used this before, and knows what kind of problems I'm talking about? I've been following this tutorial as well as following this, but neither seems to work and I can't quite figure out why.

Edit: Wait I think I figured out the problem, just not the solution. The problem lies, mostly, within the tutorial I was reading where they explain that the slope of a line leading from the origin (top left) to a source of sight (ie the player) has a slope of -1. It does, but only if the player is transformed to be the origin, and everything has polar coordinates related to it. Otherwise the slope is positive. So now I just need to figure out some wonky slope and octant and transformations and ugh my brain hurts.

http://roguebasin.roguelikedevelopment.org/index.php?title=FOV_using_recursive_shadowcasting_-_improved

Have you ever taken a look at that example, that's what i used for making a simple game and it worked fine.

huge sesh
Jun 9, 2008

Can anyone help me with this OpenGL question? I'm trying to render a spherical billboard for characters in a game such that they don't get distorted by the camera angle. The catch is that making the billboards perpendicular to the camera angle makes them clip into objects around them in ways I don't want--I want them to get occluded based on a quad that stands upright in object space. I've attached a scrappy illustration of the problem and what I want. I'm targeting iPhone OpenGL ES 1.1, so I don't have access to shaders.

Only registered members can see post attachments!

Vietnom nom nom
Oct 24, 2000
Forum Veteran
Just wanted to thank everyone for their replies, since I forgot to do so during the distraction of the holidays.

Pfhreak posted:

If you really have a worst case situation where every single entity can update every single sub-entry, then you can't beat O(n^2) in the worst case. You are stuck with a huge rear end iteration. Switching into C might buy you some speed improvements, but my guess is they won't be drastic.

It's too bad Lua doesn't have a more straightforward way to implement parallelization as this seems like a good problem to leverage it for (since each of the updates to the various tables is discrete).

chips
Dec 25, 2004
Mein Führer! I can walk!

huge sesh posted:

Can anyone help me with this OpenGL question? I'm trying to render a spherical billboard for characters in a game such that they don't get distorted by the camera angle. The catch is that making the billboards perpendicular to the camera angle makes them clip into objects around them in ways I don't want--I want them to get occluded based on a quad that stands upright in object space. I've attached a scrappy illustration of the problem and what I want. I'm targeting iPhone OpenGL ES 1.1, so I don't have access to shaders.



Could you project the texture onto your upright quad from the camera perspective? The only other way I can think of doing it is to turn off depth testing in OpenGL for that quad, but that will mess up if your scene isn't depth ordered.

Contero
Mar 28, 2004

huge sesh posted:

Can anyone help me with this OpenGL question? I'm trying to render a spherical billboard for characters in a game such that they don't get distorted by the camera angle. The catch is that making the billboards perpendicular to the camera angle makes them clip into objects around them in ways I don't want--I want them to get occluded based on a quad that stands upright in object space. I've attached a scrappy illustration of the problem and what I want. I'm targeting iPhone OpenGL ES 1.1, so I don't have access to shaders.



If you draw your billboard straight up and down but adjust the height to what the camera would see at that angle you should get what you want. Do some trig/geometry to figure it out.

huge sesh
Jun 9, 2008

Contero posted:

If you draw your billboard straight up and down but adjust the height to what the camera would see at that angle you should get what you want. Do some trig/geometry to figure it out.

Just realized I could do this last night, thanks y'all.

SlightlyMadman
Jan 14, 2005

Has anyone found a good solution yet for 2d tile-based games in python? Rabbyt still looks like the best bet, but last time I tried it (probably a year ago), I could never get the performance out of it that I expected.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

Krackbaby posted:

Just wanted to thank everyone for their replies, since I forgot to do so during the distraction of the holidays.


It's too bad Lua doesn't have a more straightforward way to implement parallelization as this seems like a good problem to leverage it for (since each of the updates to the various tables is discrete).

Well, parallelization isn't generally an enormous boost. Remember that O(n^2) = O(1/4*n^2). Ultimately you'll get a bigger boost from limiting the set of operations you have to do somehow.

Yay
Aug 4, 2007

SlightlyMadman posted:

Has anyone found a good solution yet for 2d tile-based games in python? Rabbyt still looks like the best bet, but last time I tried it (probably a year ago), I could never get the performance out of it that I expected.

I've been experimenting with the python cocos2d, which is pretty good. It certainly has classes & objects for dealing with tiles, and is 'just' a useful wrapper around pyglet functionality. Presumably, you could plug rabbyt and pymunk and whatever else in, should you want. (Don't get distracted by the ridiculous transforms the lead videos demonstrate). But what performance issues were you running into with anything tile based? I'm genuinely intrigued and perplexed.

SlightlyMadman
Jan 14, 2005

Ah cool, I tried cocos2d briefly some time ago, but abandoned it for some reason I don't remember. Most likely I either didn't notice the tile classes, or they hadn't existed yet. I'll give it another shot.

The problems I run into are just that screen blitting seems to be horribly slow in both pygame and pyglet. Once you get to updating a few hundred tiles or so, frame rates can drop down into single-digit territory, even on modern hardware. I've been able to get it up to tolerable levels using psyco but unfortunately it's not compatible with 64-bit processors so that's not really an option anymore.

Yay
Aug 4, 2007

SlightlyMadman posted:

The problems I run into are just that screen blitting seems to be horribly slow in both pygame and pyglet. Once you get to updating a few hundred tiles or so [...]
As I've never used pygame, and have only really begun to fiddle with cocos2d (and thus pyglet), I'm not in a position to advise massively, but were you making use of sprite groups and batching? The single biggest slowdown I've seen people experiencing is that they're not batching. I presume batching is a fancy term for blitting multiple dirty areas to the screen at once, instead of doing each sprite individually.

Of course, there aren't that many first-class projects that have used any of these libraries (to my limited awareness), so there doesn't seem to be much heavy-duty, real-world experience being talked up (or down).

SlightlyMadman
Jan 14, 2005

Yeah, batching helps quite a bit, but the frameworks really seem to work best for games where you have a mostly stationary screen, with a small number of moving sprites. When you have a top-down rpg-like map, you end up with one stationary sprite and every single other tile on the screen moving around it.

For example, I wrote this game a little while ago:
http://drupal.atzok.com/demon_keeper

Running on my brand new laptop, I get about 20fps at 800x600.

Scaevolus
Apr 16, 2007

SlightlyMadman posted:


I'm pretty sure pygame uses (embarassingly slow) software blitting-- did you try this in pyglet + rabbyt? They have demos with hundreds of moving sprites and good performance.

Scaevolus fucked around with this message at 02:15 on Jan 5, 2010

Adbot
ADBOT LOVES YOU

SlightlyMadman
Jan 14, 2005

Scaevolus posted:

I'm pretty sure pygame uses (embarassingly slow) software blitting-- did you try this in pyglet + rabbyt? They have demos with hundreds of moving sprites and good performance.

Yeah, I think I even posted it in this very thread, but I at one point rewrote the entire tile engine to use pyglet/rabbyt and only saw a marginal improvement, and missed some of the extra functionality of pygame. It was at least a year or two ago though, so I'll give it another shot on my next project.

Is rabbyt or cocos the better choice?

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