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
NeerWas
Dec 13, 2004

Everyday I'm shufflin'.

NeerWas fucked around with this message at 21:47 on Aug 9, 2023

Adbot
ADBOT LOVES YOU

MasterSlowPoke
Oct 9, 2005

Our courage will pull us through
you're way, way too green for an mmo

NeerWas
Dec 13, 2004

Everyday I'm shufflin'.

NeerWas fucked around with this message at 21:46 on Aug 9, 2023

NeerWas
Dec 13, 2004

Everyday I'm shufflin'.

NeerWas fucked around with this message at 21:46 on Aug 9, 2023

Vinterstum
Jul 30, 2003

Sindow posted:


For another less annoying topic, are there any P2P MMO projects? I know there are a few projects for distributed computing and since XNA only allows peer to peer and only 31 players I know there was some interest in doing something like that. It'd be neat to see what people could do with that.

Not as far as I know, and it's not very likely that it'll happen either. If you don't have a central trusted server, cheating and hacking would be completely rampant and unmanageable (especially given the added incentive for doing so given the typical MMO progression). The only way to prevent that would be a game without any sort of competition or progression whatsoever, which... isn't really a game.

And doing so just to work around some limitations of XNA isn't very likely either :).

Vinterstum fucked around with this message at 11:44 on Aug 9, 2009

Intel Penguin
Sep 14, 2007
hooray
You could still make an MMO with XNA. You just wouldn't use the XNA multiplayer libraries. Also this would mean it would work on the PC only.

more falafel please
Feb 26, 2005

forums poster

Sindow posted:

I know DirectPlay is depreciated and Microsoft is removing support for it so they can push their stupid Windows Gaming Live! bullshit, but does anyone know what platforms it will still work on? They say the dlls were removed from Vista but according to this website, the dplay dll is still in Windows 7. I would assume that means that the NAT Traversal stuff is still in there, but how well will it work?

Games For Windows Live! uses the XBL APIs, right? Because trust me, it doesn't get much easier to use than the XBL APIs.

bloodychill
May 8, 2004

And if the world
should end tonight,
I had a crazy, classic life
Exciting Lemon
Alright, I have a multi-part question. So, I'm writing an indie game that uses animated sprites using SFML. Right now, the code just pulls the sprites off of whatever hard drive location and these sprites are easily viewable/usable by the user. My questions are these:

1. Right now I'm using zlib/minizip to encrypt data files, but PNG's will be a little bit of a pain to decrypt using zlib with SFML. Is there an easier solution that I'm not aware of?

2. Should I even bother to encrypt in the first place? I plan to make money from the project but is there are a problem in the industry with people stealing copyrighted sprite graphics for other uses?

Vinterstum
Jul 30, 2003

bloodychill posted:

Alright, I have a multi-part question. So, I'm writing an indie game that uses animated sprites using SFML. Right now, the code just pulls the sprites off of whatever hard drive location and these sprites are easily viewable/usable by the user. My questions are these:

1. Right now I'm using zlib/minizip to encrypt data files, but PNG's will be a little bit of a pain to decrypt using zlib with SFML. Is there an easier solution that I'm not aware of?

2. Should I even bother to encrypt in the first place? I plan to make money from the project but is there are a problem in the industry with people stealing copyrighted sprite graphics for other uses?

However you try to encrypt protect your data, if your game gets popular enough, the data formats -will- get cracked (if your game can decrypt them, so can the guy with a copy of the game and some reverse engineering experience).

I'd just use some kind of archive format that packs multiple sprites into one file. There's many reasons why this is a good thing, and as an extra bonus it means a bit of effort to copy your graphics, which is all you really need.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

bloodychill posted:

2. Should I even bother to encrypt in the first place? I plan to make money from the project but is there are a problem in the industry with people stealing copyrighted sprite graphics for other uses?

Like the poster above me said, jam them into one data file, but don't bother encrypting them. No one is going to steal your content. This is one of the biggest concerns people have, yet it is totally unfounded. Yes, there will probably be some highschool kiddie out there who unpacks your content and pokes around. Maybe uses it in some personal project. Another developer might some day come along and use it as placeholders for their own game. But honestly, you are putting the stuff on screen, it's not like it isn't easily accessible there.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Someone might use your assets in a sprite comic, though. :gonk:

NeerWas
Dec 13, 2004

Everyday I'm shufflin'.

NeerWas fucked around with this message at 21:46 on Aug 9, 2023

bloodychill
May 8, 2004

And if the world
should end tonight,
I had a crazy, classic life
Exciting Lemon
Thanks for the advice guys. I had a feeling encryption was unnecessary, I guess I just needed someone to say it.

Twernmilt
Nov 11, 2005
No damn cat and no damn cradle.
I'm trying to get a simple animation framework up and running, but I'm getting some extreme flicker when it runs. I can get rid of it by making the period very high, but obviously I want to keep the FPS reasonable. Below are the three relevant methods for running the game and double buffering the image.

code:
    public void run()
    {
        long beforeTime, afterTime, timeDiff, sleepTime;
        long overSleepTime = 0L;
        long period        = 20000000L;
        int noDelays       = 0;
        long excess        = 0L;
        gameRunning        = true;

        while(gameRunning)
        {
            beforeTime = System.nanoTime();
            gameUpdate();
            gameRender();
            paintScreen();
            afterTime = System.nanoTime();
            
            timeDiff = afterTime - beforeTime;
            sleepTime = (period - timeDiff) - overSleepTime;

            if(sleepTime > 0)
            {
                try
                {
                 Thread.sleep(sleepTime/1000000L); //convert nanos -> micros
                } //try
                catch(InterruptedException ex){}
                overSleepTime = (System.nanoTime() - afterTime) - sleepTime;
            }
            else
            {
                excess -= sleepTime;
                overSleepTime = 0L;

                if(++noDelays >= NUMBER_OF_DELAYS_PER_YIELD)
                {
                    Thread.yield();
                    noDelays = 0;
                }
            }

            int skips = 0;
            while((excess > period) && (skips < MAX_FRAME_SKIPS))
            {
                excess -= period;
                gameUpdate();
                skips++;
            }
        } // while(gameRunning)
        System.exit(0);
    } //run

    private void gameRender()
    {
        if(bufferImage == null)
        {
            bufferImage = createImage(PWIDTH, PHEIGHT);
            if(bufferImage == null)
            {
                System.out.println("bufferImage is null");
                return;
            } //if(bufferedImage == null)
            else
                bufferGraphics = bufferImage.getGraphics();
        } //if(bufferImage == null)

        //clear the backgroud
        bufferGraphics.setColor(Color.white);
        bufferGraphics.fillRect(0, 0, PWIDTH, PHEIGHT);

        //draw game elements
        drawEarth(bufferGraphics);

        if(gameOver)
            gameOverMessage(bufferGraphics);
    } //gameRender()

    private void paintScreen()
    {
        Graphics g;
        try
        {
            g = this.getGraphics();
            if((g != null) && (bufferImage != null))
                g.drawImage(bufferImage, 0, 0, null);
            Toolkit.getDefaultToolkit().sync();
            g.dispose();
        }
        catch(Exception e)
        {
            System.out.println("Graphics context error: " + e);
        }
    } //paintScreen

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Why are you not just using vsync?

Intel Penguin
Sep 14, 2007
hooray
or double buffering?

Twernmilt
Nov 11, 2005
No damn cat and no damn cradle.
I don't know why I'm not using vsync and I thought I was double buffering. I'm drawing to bufferImage in the render step and then displaying it to the screen in the paintScreen step. Or so I thought...

Tulenian
Sep 15, 2007

Getting my 'burg on.
You're only using one buffer.

Vinterstum
Jul 30, 2003

Tulenian posted:

You're only using one buffer.

The screen is a buffer too.

Intel Penguin
Sep 14, 2007
hooray
are you possibly clearing the screen and not the backbuffer?

Twernmilt
Nov 11, 2005
No damn cat and no damn cradle.
I don't believe so. bufferGraphics gets its context from bufferImage and then clears it before rendering the frame. In the print method, g gets its context from the class itself, which is the window.

Edit: Well, in case anyone has the same problem, I ended up using Java's standard BufferStrategy class. It is unclear to me why this solved my problem, but it did.

Twernmilt fucked around with this message at 15:06 on Aug 21, 2009

NeerWas
Dec 13, 2004

Everyday I'm shufflin'.

NeerWas fucked around with this message at 21:46 on Aug 9, 2023

Intel Penguin
Sep 14, 2007
hooray
x, y, and mipmap level?

NeerWas
Dec 13, 2004

Everyday I'm shufflin'.

NeerWas fucked around with this message at 21:46 on Aug 9, 2023

akadajet
Sep 14, 2003

Try looking at it with reflector.

NeerWas
Dec 13, 2004

Everyday I'm shufflin'.

NeerWas fucked around with this message at 21:44 on Aug 9, 2023

chglcu
May 17, 2007

I'm so bored with the USA.

akadajet posted:

Try looking at it with reflector.
I got curious, so I did this. The ranks control the amount of data read from the capture buffer and the format of the return value, so:
code:
// reads 256 bytes and returns byte[256]
captureBuffer.Read(0, typeof(byte), LockFlag.None, 256);
// reads 256*128 bytes and returns byte[256][128]
captureBuffer.Read(0, typeof(byte), LockFlag.None, 256, 128);
// reads 256*128*64 bytes and returns byte[256][128][64]
captureBuffer.Read(0, typeof(byte), LockFlag.None, 256, 128, 64);
This seems to be the only effect the parameters have. Only the total size of the array is passed on to DirectSound.

The method throws ArgumentNullException if less than one value is specified for the ranks parameter, and ArgumentOutOfRangeException if more than three values are specified. Why anyone would want anything besides a one dimensional array here, I have no idea, but I don't know much about working with sound.

chglcu fucked around with this message at 05:52 on Sep 12, 2009

Applebee123
Oct 9, 2007

That's 10$ for the spinefund.
What do you guys think about making for-profit maps in starcraft 2 editor for sale on battle.net?

Here's the video if you haven't seen it:
http://www.youtube.com/watch?v=joNPrnY4K_4

From the looks of it they are almost giving you a free engine, free game assets, a free intellectual property, a captivate audience of several million starcraft players and a free license to create for-profit games using them all (albiet with blizzard taking a cut of sales). It has support for first person shooters, 2D vertical scrolling shoot-em-ups and so on.

BizarroAzrael
Apr 6, 2006

"That must weigh heavily on your soul. Let me purge it for you."

Applebee123 posted:

What do you guys think about making for-profit maps in starcraft 2 editor for sale on battle.net?

Here's the video if you haven't seen it:
http://www.youtube.com/watch?v=joNPrnY4K_4

From the looks of it they are almost giving you a free engine, free game assets, a free intellectual property, a captivate audience of several million starcraft players and a free license to create for-profit games using them all (albiet with blizzard taking a cut of sales). It has support for first person shooters, 2D vertical scrolling shoot-em-ups and so on.

Going by WC2's editor and what I see there, it's going to be a cool tool and I look forward to playing with it.

They don't actually talk about selling maps and mods over Battle.net there, I'm not sure how I feel about that. I like the idea that a good mod might make some money for the creator, but how much are people going to want to spend on amateur maps?

Nagna Zul
Aug 9, 2008
This is probably something retarded I did and I'll figure it out tomorrow morning, but allow me to share this problem...

I've been developping a game in SDL for about 2 months now - I've even released a few working demos for it - and tonight I wanted to release a new version.

So I opened up visual studio, worked on the game for a while, then when it reached a point where I was happy with it, I decided - "ok let's release this". So I do what I usually do - build a release version (which ran fine) then take the release .exe generated by visual studio, then stick the .exe inside a separate folder with all the requisite DLLs and assets.

I run the .exe, and it crashes. Frown.

Lots of traces later, I pinpoint the source of the crash: the game crashes when I ask SDL to open a certain image. The game opens about 20 images perfectly, then it gets to 3.bmp and it crashes. 1.bmp and 2.bmp load fine.

This doesn't occur when the game is launched from visual studio, and it isn't caused by the image file itself. IMG_Load() doesn't return a null pointer or an error code or anything - it just crashes.

What do I do in this situation?

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!

Nagna Zul posted:

This is probably something retarded I did and I'll figure it out tomorrow morning, but allow me to share this problem...

I've been developping a game in SDL for about 2 months now - I've even released a few working demos for it - and tonight I wanted to release a new version.

So I opened up visual studio, worked on the game for a while, then when it reached a point where I was happy with it, I decided - "ok let's release this". So I do what I usually do - build a release version (which ran fine) then take the release .exe generated by visual studio, then stick the .exe inside a separate folder with all the requisite DLLs and assets.

I run the .exe, and it crashes. Frown.

Lots of traces later, I pinpoint the source of the crash: the game crashes when I ask SDL to open a certain image. The game opens about 20 images perfectly, then it gets to 3.bmp and it crashes. 1.bmp and 2.bmp load fine.

This doesn't occur when the game is launched from visual studio, and it isn't caused by the image file itself. IMG_Load() doesn't return a null pointer or an error code or anything - it just crashes.

What do I do in this situation?

Is the size of 3.bmp a power of 2?

Nagna Zul
Aug 9, 2008

guenter posted:

Is the size of 3.bmp a power of 2?

Yes, it's 16x16, though I've had SDL load things that weren't powers of 2.

Also - I should mention that this crash is weird because - the game first loads this set of 13 images, which represent the main character, then it loads them again into a different variable to then reverse the images. So 3.bmp CAN load fine.

E: It isn't tied to that particular image, either - after a reboot and a night's worth of sleep, the game now loads 3.bmp just fine but crashes on 4.bmp

Fecotourist
Nov 1, 2008

Nagna Zul posted:

E: It isn't tied to that particular image, either - after a reboot and a night's worth of sleep, the game now loads 3.bmp just fine but crashes on 4.bmp

Crashing on the image load is a red herring. The actual bug is happening well before the image loading. You're double-freeing, or overrunning a block in the heap and trashing the malloc header. Then, much later, some random allocation (just coincidentally when you're loading an image) dereferences that trashed pointer.

Smugdog Millionaire
Sep 14, 2002

8) Blame Icefrog

BizarroAzrael posted:

I like the idea that a good mod might make some money for the creator, but how much are people going to want to spend on amateur maps?

Given the unbelievable popularity of DotA, I'd guess the answer is "some" which is enough to generate profit for Blizzard.

Nagna Zul
Aug 9, 2008

Fecotourist posted:

Crashing on the image load is a red herring. The actual bug is happening well before the image loading. You're double-freeing, or overrunning a block in the heap and trashing the malloc header. Then, much later, some random allocation (just coincidentally when you're loading an image) dereferences that trashed pointer.

Good intuition.

Double free-ing is impossible, because this happens at initialization, before anything gets freed. Looking through the code that runs before the crash, it's all very very basic stuff, nearly all the allocation is done by SDL - I don't think there's a crash there either.

I did fix the problem - I think - because it doesn't crash anymore.

The solution, as I knew it was gonna come, came to me in a dream - ok, I thought of it when my alarm clock sounded: instead of loading the same image twice (which was a retarded shortcut/hack) I actually went into SDL's documentation and looked up how to create an empty surface. So instead of loading the same image twice (which maybe SDL doesn't like??) I load it once, create an empty surface of the same size, and then reverse the image into the empty surface, which works perfectly.

So...yeah, lesson learned: go to bed when the crashes stop making sense, it'll make sense in the morning.

Fecotourist
Nov 1, 2008
Are you reversing the image yourself or using a library routine? If the former, look that code over to make sure you're not writing to pixel (-1,0) or something, that's where the heap header would be.

Nagna Zul
Aug 9, 2008

Fecotourist posted:

Are you reversing the image yourself or using a library routine? If the former, look that code over to make sure you're not writing to pixel (-1,0) or something, that's where the heap header would be.

It's very much self-written - SDL doesn't support it for some reason, I tried to blit using a negative width rectangle but it uses unsigned ints. While it seems to work I'd love to have it double checked:

code:
for (int i=0;i<ReverseAvatarSet[k]->h;i++)
{
  for (int j=0;j<ReverseAvatarSet[k]->w;j++)
  {
    SetPixel(ReverseAvatarSet[k], (ReverseAvatarSet[k]->w - 1) - j, i, (GetPixel(AvatarSet[k], j, i)));
  }
}
AvatarSet is the vector of images representing the main character, and ReverseAvatarSet is the one that holds all the same images, only flipped horizontally. h and w are height and width.

SetPixel takes the destination surface, x and y coordinates and the value of the pixel. GetPixel works similarly.

Basically I go through every pixel of the image, then apply that pixel to the reversed image, but reversing the x coordinate.

Does that make any sense?

BizarroAzrael
Apr 6, 2006

"That must weigh heavily on your soul. Let me purge it for you."

Free Bees posted:

Given the unbelievable popularity of DotA, I'd guess the answer is "some" which is enough to generate profit for Blizzard.

True but putting a price on maps, assuming there is no way to opt out and make your stuff free (allowing you to make "demo versions") is going to be a barrier to a lot of people and hamper exposure. Would DotA have taken off the same way if, early on, people had no idea what they would be getting? That would damage the "word of mouth" spreading of the mod.

Also, will this effect how updates are made? Will you have to pay again every time something is updated, or will you be entitled to the current version at any time after buying?

Fecotourist
Nov 1, 2008

Nagna Zul posted:

code:
CODE

Looks ok to me. I assume this is your new code that reverses into an empty image. The old in-place routine is where I'd expect the bug. But, water under the bridge...

Adbot
ADBOT LOVES YOU

PnP Bios
Oct 24, 2005
optional; no images are allowed, only text
Is there any scripting engine for .net? I'd like to be able to use some ECMA or python in a game I'm working on.

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