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
The Golden Gael
Nov 12, 2011

Here's a trailer for the second major game I'm making. After three years I'm less than a month away from release. :feelsgood: Here's a demo from a year and a half ago if anyone's interested - the file is really, really big I realize, and this has been addressed and will be dealt with in the final release.

The first game I ever made was a simple tank game. The AI was very limited but it was my first time ever programming that kind of stuff and I was experimenting with everything - sound, particles, the style ('80s/'90s revivalism, which I seem to be ace at). Here's a link to that too if anyone wants to try! It's three years old so don't judge it as the apex of what I do now.

Adbot
ADBOT LOVES YOU

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!
Update on the Marathon Infinity WebGL project. I've rewritten the basic parts of the Marathon Infinity renderer from scratch and can now display level geometry. (With a little advice from pianospleen.) It's still feature poor, but it runs buttery smooth in a web browser. You can fly around the level geometry with all the necessary polys, textures, and mission info streamed in.

Also, the map follows the player now as you fly around.

Here's an interior shot:


And here's an exterior shot:


Edit: I'd like to get a video of it in action, what are the cool kids using for screen capture these days?

Svampson
Jul 29, 2006

Same.

Pfhreak posted:

Edit: I'd like to get a video of it in action, what are the cool kids using for screen capture these days?

I use FRAPS, I don't recall what the limitations are for the trial version but the full version costs $37 and it has served me very well throughout the years

Oh and the Marathon port is super cool, keep up the good work :D

Nalin
Sep 29, 2007

Hair Elf
PlayClaw and Dxtory are two alternatives to Fraps that I see that often get used. I personally use PlayClaw for all my recording needs. They all have their pluses and minuses, so try them out and see what works for you.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Svampson posted:

I use FRAPS, I don't recall what the limitations are for the trial version but the full version costs $37 and it has served me very well throughout the years

Oh and the Marathon port is super cool, keep up the good work :D
The free version limits you to clips of 30 seconds or less, or thereabouts. Doesn't really matter, unless you're trying for long unbroken gameplay footage.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!
I am this close to getting the lights to work in Marathon, but I'm running into a GLSL issue I can't figure out.

My map has 26 lights, each with an intensity from 0 to 1, so I created a uniform float[26] in my shader. Every frame I pass it something like [1,.95,.90...,.2].

Next, I planned to multiply my color by the appropriate intensity for that surface.

code:
precision mediump float;

varying vec3 vTextureCoord; // Texture coordinates + light index (0-25)     
uniform sampler2D uSampler;         
                                                
const int NUM_SURFLIGHTS=26;         
uniform float uSurfLights[NUM_SURFLIGHTS]; // Holds the intensities of all the lights
vec4 col;
float alph;
int src;

void main(void) {			
  // Get the color from the texture
  col = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));
  // Store the alpha
  alph = col.a; 
  // Get the light source index (0-25)
  src = int(vTextureCoord.p);
  // Multiply the color by the light intensity
  [b]col = col * uSurfLights[src];[/b] // This is where I fail
  // Restore the alpha
  col.a = alph;
  // Set the color of the pixel
  gl_FragColor = col; 
}
I'm running into this issue where it says that my index needs to be a constant expression. Specifically that uSurfLights[src] is invalid code. It works wonderfully if I put in uSurfLights[21], but not if I try to use src.

Is there a better way to pass the light indices to the shader so I can look up their intensities? Is there a better way to pass the intensities so I can look them with non-constant expressions?

Edit: I 'fixed' it by looping from i=0 to NUMLIGHTS and checking against src. Hackish as hell.

Pfhreak fucked around with this message at 05:54 on May 3, 2012

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
http://www.khronos.org/registry/webgl/specs/latest/

quote:

Appendix A mandates certain forms of indexing of arrays; for example, within fragment shaders, indexing is only mandated with a constant-index-expression (see [GLES20GLSL] for the definition of this term). In the WebGL API, only the forms of indexing mandated in Appendix A are supported.

Also you since there's only one light per surface, you should really do the lookup in the vertex shader and just stuff the result in an interpolator.

Lucid Dream
Feb 4, 2003

That boy ain't right.
Anybody have any ideas on how to store data for a terraria-esque block game? I started doing it with XML, serializing each row like <row>blockid|otherdata,blockid|otherdata,...</row> but it seems like an rear end way to handle it. Ideally I want to save the data in such a way that I can save and load chunks of the map without having to save/load the entire thing at once.
As for player/entity data I was thinking about storing that stuff in an sqlite database or something, does that seem retarded?

Mata
Dec 23, 2003

Lucid Dream posted:

Anybody have any ideas on how to store data for a terraria-esque block game? I started doing it with XML, serializing each row like <row>blockid|otherdata,blockid|otherdata,...</row> but it seems like an rear end way to handle it. Ideally I want to save the data in such a way that I can save and load chunks of the map without having to save/load the entire thing at once.
As for player/entity data I was thinking about storing that stuff in an sqlite database or something, does that seem retarded?

Well... What you have going there is a combination of CSV and XML, a pure XML way to do it would be for example
pre:
<row>
  <block id="1">
    <otherdata key="value" />
  </block>
</row>
I use XML for a lot of things in my projects but if I were you I wouldn't use it here. If all you want to do is store block types then I would just store the data like a blob:
00 12 00 00 00
23 55 25 11 11
where each 2 digit number represents a tile type. If you want to store more data about each block than just type, then the approach you describe seems fine :) But the <row> tag is unnecessary.
If you want to save/load separate chunks individually I think the easiest way to do that is to split it up into separate files. If you're concerned with locality of reference then you can concatenate these files and read them individually at runtime: like, you'd have each map basically be an uncompressed zipfile that contains 64 smaller files for each "chunk" of the level)

Mata fucked around with this message at 14:34 on May 3, 2012

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

OneEightHundred posted:

http://www.khronos.org/registry/webgl/specs/latest/


Also you since there's only one light per surface, you should really do the lookup in the vertex shader and just stuff the result in an interpolator.

This is my first time writing shaders beyond "Get texture coordinates; paint;" can you go into just a little more detail? The vertex shader is pretty basic:

code:
attribute vec3 aVertexPosition; // XYZ coords
attribute vec3 aTextureCoord;   // XY Texcoords + Light ID           
uniform mat4 uMVMatrix;         // Model-View Matrix           
uniform mat4 uPMatrix;          // Projection Matrix       
                                                   
varying vec3 vTextureCoord;                
void main(void) {                           
  gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);
  vTextureCoord = aTextureCoord;        
}

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
"Interpolators" for GLSL means "varying" vars. "Interpolators" is a term occasionally used for them because fragments get a result that's interpolated between 3 of them.

Basically, do the lookup in the vertex shader, stuff it in a varying, and get that in the pixel shader. It's generally a good idea to do as much as you can in the vertex shader because, for obvious reasons, they execute much less often.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

OneEightHundred posted:

"Interpolators" for GLSL means "varying" vars. "Interpolators" is a term occasionally used for them because fragments get a result that's interpolated between 3 of them.

Basically, do the lookup in the vertex shader, stuff it in a varying, and get that in the pixel shader. It's generally a good idea to do as much as you can in the vertex shader because, for obvious reasons, they execute much less often.

Got it. I'll see if I can't make that happen this evening. I stayed up entirely too late last night watching all the lights in the first level flicker and fade.

kaempfer0080
Aug 22, 2011


Certified Weeb

Going to repost my shitpost in hopes of getting a reply. Originally from the Post a SS thread but my question belongs here.

quote:

I made a remake of Yar's Revenge for the Atari in Java for a class. I named it Char's Revenge.

Image removed

It was a fun project but I can't help but feel my code wasn't quite a sterling avatar of the OO paradigm. I had a game object that kept track of things like collision detection and held all the objects like the shield and enemy. That much I think is fine, but I also had dozens of methods that would just call methods on the games objects, so other classes could interact with them. Things like:

public void shieldFunction(){
doFunctionOfShield();
}

So that some other object could interact with another, if you know what I mean.

As a very green programmer I just couldn't think of another way of doing it, and I'm not even sure if it's a poor practice, but the phrase "catapillar programming" comes to mind.

Unormal
Nov 16, 2004

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

kaempfer0080 posted:

Going to repost my shitpost in hopes of getting a reply. Originally from the Post a SS thread but my question belongs here.

I'm not 100% sure what you're trying to accomplish here, but usually you want to communicate between components with an events/message pattern. So, conceptually, you might have a "ShieldsUp" event, for instance, and classes/components/other objects would register for notification when that event gets fired.

Just something to get you started: http://en.wikipedia.org/wiki/Observer_pattern

Unormal fucked around with this message at 20:14 on May 3, 2012

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.

kaempfer0080 posted:

I also had dozens of methods that would just call methods on the games objects, so other classes could interact with them. Things like:

public void shieldFunction(){
doFunctionOfShield();
}

So that some other object could interact with another, if you know what I mean.

I'm not sure I do know what you mean. How does having a shieldFunction method help other objects interact with each other in a way that having them call doFunctionOfShield directly couldn't accomplish?

Would you be able to post a short example of how something like shieldFunction() gets used? It might help us understand what you're trying to do here.

Physical
Sep 26, 2007

by T. Finninho
Is there a way to share an XNA GraphicsDevice between two XNA.Game objects?

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!
What's that you say? You want to see the lights in Aleph Web?



Wait, hold on, a static shot doesn't really do them justice...

Yes, I think a youtube link will do better: http://www.youtube.com/watch?v=i8Me6KZQ-iw New higher quality video!

Pfhreak fucked around with this message at 16:59 on May 4, 2012

Paniolo
Oct 9, 2007

Heads will roll.

Physical posted:

Is there a way to share an XNA GraphicsDevice between two XNA.Game objects?

I'm far from an XNA expert, but it seems like you're intended to have one Game instance per application. Can you explain why you would want more?

The Glumslinger
Sep 24, 2008

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


Hair Elf
Here is a (quickly put together) trailer of the game I worked on all year:

http://www.youtube.com/watch?v=QUecPRdRmOM&feature=youtu.be

And a poster, which looks had slightly more time put into it :v:

Jewel
May 2, 2009

crazylakerfan posted:

Here is a (quickly put together) trailer of the game I worked on all year:

http://www.youtube.com/watch?v=QUecPRdRmOM&feature=youtu.be

And a poster, which looks had slightly more time put into it :v:



Woah, I really like this! If you could polish it enough and get it to a decent length, a game like this could easily sell.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?
Just a reminder that SA GameDev VII is almost here. This year's entries, as with every year, will verily kick much rear end I am certain.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

Shalinor posted:

Just a reminder that SA GameDev VII is almost here. This year's entries, as with every year, will verily kick much rear end I am certain.

I am very excited for this, I had a blast last year. It's only going to be better this year. Any ideas on the theme yet? This year it's something mechanical, if the pattern still holds, right?

Svampson
Jul 29, 2006

Same.
Last year was so much fun, I'll probably sign up again this year! Best part was chilling out in the SA GameDev channel with a bunch of you guys :3: (The next best thing was winning SUCK IT LOSERS)

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

Svampson posted:

Last year was so much fun, I'll probably sign up again this year! Best part was chilling out in the SA GameDev channel with a bunch of you guys :3: (The next best thing was winning SUCK IT LOSERS)

I'm gunning for you this year, Svampson! Unless, you know, you want to combine forces to utterly dominate the field.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Pfhreak posted:

I am very excited for this, I had a blast last year. It's only going to be better this year. Any ideas on the theme yet? This year it's something mechanical, if the pattern still holds, right?
It is something that will force design, instead of being an open something you can match with just a visual aesthetic, yes.

Yes, it has been chosen already.

Svampson
Jul 29, 2006

Same.

Pfhreak posted:

I'm gunning for you this year, Svampson! Unless, you know, you want to combine forces to utterly dominate the field.
In case you don't have a art guy lined up I would love trying out focusing on art for once since I'm currently working on improving my 3D modelling skills (Tough I mostly do silly low-poly stuff)
You, Rupert Buttermilk and me! Together we could burn the entire competition to the ground :black101:

kaempfer0080
Aug 22, 2011


Certified Weeb

PDP-1 posted:

I'm not sure I do know what you mean. How does having a shieldFunction method help other objects interact with each other in a way that having them call doFunctionOfShield directly couldn't accomplish?

Would you be able to post a short example of how something like shieldFunction() gets used? It might help us understand what you're trying to do here.

Sure, I'll try to give an example of how I used it. I don't think I would've had this problem if it weren't a graphical application, but because of that I had a Window and Graphics object that needed to act on other objects; or at least tell them to act.

For example, when the graphics class wants to draw the player. It needs to draw it at the players current position, which is a private variable(a Point object) of the player object. I got this information by calling the game class' getPlayerPosition() function.



Maybe this will be a better example. The graphics class is drawing the shield, which it needs the position of the shield for just like it does the player. However, the shield moves up and down the screen on it's own using a function inside the shield class. That function just checks to make sure the shield isn't going to fall off the screen and then updates it's x/y coordinates.

The graphics class, when it wants to draw the shield, firsts tells the shield to move itself by calling that function. Again, it has to use the method via the game class. It then uses another method to grab the x/y coordinates and draw the shield.

Hope that was enough info. I'd post the source code but it's on my laptop which is elsewhere at the moment.


Unormal posted:


Thanks, this was an interesting read.

kaempfer0080 fucked around with this message at 23:38 on May 4, 2012

DrMelon
Oct 9, 2010

You can find me in the produce aisle of the hospital.

crazylakerfan posted:

Here is a (quickly put together) trailer of the game I worked on all year:
:words:

I like the aesthetic, it reminds me a lot of earlier Ratchet & Clank games.

Rupert Buttermilk
Apr 15, 2007

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

Svampson posted:

In case you don't have a art guy lined up I would love trying out focusing on art for once since I'm currently working on improving my 3D modelling skills (Tough I mostly do silly low-poly stuff)
You, Rupert Buttermilk and me! Together we could burn the entire competition to the ground :black101:

My heart-meter fills with pride. I'm down with all of this.

Less than a month until we can say 'One month until we start our engines!' :toot:

The Glumslinger
Sep 24, 2008

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


Hair Elf

DrMelon posted:

I like the aesthetic, it reminds me a lot of earlier Ratchet & Clank games.

Makes sense since that was one of our frequent references when discussing what we wanted with our artists.

Also, sign me up for the Dev Jam this year. I don't start my job until August and I wanted to get in one last indie project before hand.

Will there be a thread where we can discuss our skills to try to form teams?

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

crazylakerfan posted:

Will there be a thread where we can discuss our skills to try to form teams?
Yep, you get a whole month/thread for that. Next month, theme is announces, and you get until July to figure out teams and plan/investigate.

Paniolo
Oct 9, 2007

Heads will roll.

kaempfer0080 posted:

Sure, I'll try to give an example of how I used it.
:words:

Sounds like the problem may be how you are organizing your classes. If you have a single class encapsulating the graphics engine, you should not ask it to draw your entities; you should ask your entities to draw themselves, using some generic methods provided by the graphics class.

Rupert Buttermilk
Apr 15, 2007

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

Just want to say now (and I'll repeat it again) that I greatly appreciate any and all effort you put into the Game Dev challenge every year, Shalinor. You, as well as all of the donators/judges really help round the entire thing out and make it feel really special. This'll be my fourth year being involved (though last year was the only time I was a part of a finished product) and I'm always excited to read the thread with everyone's contributions and posts.

kaempfer0080
Aug 22, 2011


Certified Weeb

Paniolo posted:

Sounds like the problem may be how you are organizing your classes. If you have a single class encapsulating the graphics engine, you should not ask it to draw your entities; you should ask your entities to draw themselves, using some generic methods provided by the graphics class.

I actually had this same thought last night when I went to bed. I used the Game class as an intermediary between graphical classes and game assets. The Game class should've been an umbrella containing all that junk instead of an in-between point.

Paniolo
Oct 9, 2007

Heads will roll.

kaempfer0080 posted:

I actually had this same thought last night when I went to bed. I used the Game class as an intermediary between graphical classes and game assets. The Game class should've been an umbrella containing all that junk instead of an in-between point.

That isn't much better. You should not have any "umbrella" class containing a lot of junk.

Maybe you should try not using OOP until you're more comfortable with it? I think it's probably easier for beginners to use a procedural style, despite the fact that most of the languages recommended for beginners these days are object oriented.

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!

Paniolo posted:

That isn't much better. You should not have any "umbrella" class containing a lot of junk.

Maybe you should try not using OOP until you're more comfortable with it? I think it's probably easier for beginners to use a procedural style, despite the fact that most of the languages recommended for beginners these days are object oriented.
Procedural style would pretty much be to have an umbrella class containing a lot of junk. That's your global variables of a procedural-style game, as implemented in an OO language.

Paniolo
Oct 9, 2007

Heads will roll.

roomforthetuna posted:

Procedural style would pretty much be to have an umbrella class containing a lot of junk. That's your global variables of a procedural-style game, as implemented in an OO language.

That's a fine approach for a beginner. Either do OOP right, or don't do it at all; the huge headaches live in the middle.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Heyo, I feel like dabbling in 2D game development, sprite based stuff primarily to start off with. I'm already building a web application in Python so that's the language I'm most comfortable in, but I'm also trying out Ruby for few things as I don't want to get too dogmatic about exploring tools. I'm willing to try some lowel level languages too, but I'm sort of looking for decent library support so I'm not reinventing the wheel all the time.

I was wondering what's a good language and library set to use for 2d game development, that works well in Linux (that's my dev platform) and can be packed / compiled to an executable in a fairly straight forward manner. Cross compile would be great but I'll probably have to start learning about using VMs I guess.

Polio Vax Scene
Apr 5, 2009



Honestly I'd stick with Python in your scenario, it has everything you want and you're already familiar with it.

Adbot
ADBOT LOVES YOU

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
kaempfer0080: You totally inspired me. I just spent a whole day playing Yar's Revenge and working on my own implementation. It's a slightly impressionistic interpretation and I just winged it on the softsynth because I don't know anything about audio.



source (Forth)

If anybody is interested in playing it, either grab my toolkit from git and compile it yourself or grab a Jar from this potentially seedy free filehosting site! I'm still tinkering with the game and adding minor features, so I'd love to hear feedback.

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