FAQ Search
Memberlist Usergroups
Profile
  Forum Statistics Register
 Log in to check your private messages
Log in to check your private messages
Moonpod Homepage Starscape Information Mr. Robot Information Free Game Downloads Starscape Highscore Table
War Pong
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Post new topic   Reply to topic    Discussion Pod Forum Index -> Game Talk View previous topic :: View next topic  

Poll Result
  How good is War Pong?  
 
It's super!
9%
 9%  [ 1 ]
It's a good distraction.
27%
 27%  [ 3 ]
It's alright, but you know...
18%
 18%  [ 2 ]
Could be better.
9%
 9%  [ 1 ]
It's bad, but it could be worse.
9%
 9%  [ 1 ]
This sucks! Why did you make me waste my time on it?
27%
 27%  [ 3 ]
 
  Total Votes : 11  

 Author
Message
ewerybody



Joined: 05 Sep 2006
Posts: 165
Location: Berlin



PostPosted: Mon Oct 30, 2006 9:46 am    Post subject: Reply with quote

I just explained how to do the effect shown in the bmp.

hehe :] I never knew that there is an effects button! I always just doubleclick since they introduced the layer effects. Laughing
Back to top
View user's profile
Konedima
Grammar Police
Grammar Police


Joined: 25 Oct 2003
Posts: 1068
Location: Sydney, Land of Censorship



PostPosted: Mon Oct 30, 2006 9:59 am    Post subject: Reply with quote

For those interested I am taking ewerybody's advice and including top/bottom caps for the paddles (mainly because I can't make a good neon paddle without them). They will be 20x25 images (because the minimum paddle height is 50), in case any skinners hint hint care. The same applies for the super shot paddle graphics.
Back to top
View user's profile Visit poster's website
Magnulus



Joined: 08 Nov 2005
Posts: 556
Location: Bergen, Norway



PostPosted: Mon Oct 30, 2006 11:46 am    Post subject: Reply with quote

I guess you'll then have a third mid-section picture for the rest of the paddle as it stretches. I suggest having that one the same height as the other ones so that modders can add a bit of texture to the length of the paddle if they would like.

Cool that it worked out! I hadn't even tested it when I suggested it. I just assumed it'd work. Very Happy The cool thing about layer effects is that now you can change the parameters at any point to tweak the glow and border effects until they look how you want them to look.
Back to top
View user's profile Visit poster's website MSN Messenger
ewerybody



Joined: 05 Sep 2006
Posts: 165
Location: Berlin



PostPosted: Mon Oct 30, 2006 12:49 pm    Post subject: Reply with quote

I see the paddle/paddle2 images are tiled for the sizeamount of the paddle but larger images in Y-direction are not valid (the image is then stretched to the maximum of the paddle).
You could also offer the skinner to create a 20 x 300(or whatever) image for the paddle wich is then simply cut off for the according size (not stretched!) and capped with the cap images. This way one could bring more depth into it.
Back to top
View user's profile
Konedima
Grammar Police
Grammar Police


Joined: 25 Oct 2003
Posts: 1068
Location: Sydney, Land of Censorship



PostPosted: Tue Oct 31, 2006 1:13 am    Post subject: Reply with quote

There is a way I can think of for having one giant image for the bat and just cutting it for length. I'm not sure how much of a performance hit it would cause (although it might help the performance since it wouldn't have to redraw the 5 pixel high image over and over).

Basically I would just create a temporary imagebuffer (of the middle section of the bat y-size) and paste the tall image into it (so the overflow goes into nothing) and then draw that on the screen. OR I think in the hidden treasure trove of blitz commands there's one that lets you draw just a section of an image. If that exists, it would probably be a lot quicker than the existing system or the one I explained before.

Since I'm sure at least one of those will work, I pose a question to ye skinners (as in ewerybody): from the big image, should I take the top, bottom or middle of it to use to make the bat when its smaller than the image?
Back to top
View user's profile Visit poster's website
Hamish
Pod Developer
Pod Developer


Joined: 15 Mar 2005
Posts: 570
Location: Auckland, NZ



PostPosted: Tue Oct 31, 2006 1:38 am    Post subject: Reply with quote

Quote:
I think in the hidden treasure trove of blitz commands there's one that lets you draw just a section of an image.


DrawImageRect
Back to top
View user's profile MSN Messenger
Konedima
Grammar Police
Grammar Police


Joined: 25 Oct 2003
Posts: 1068
Location: Sydney, Land of Censorship



PostPosted: Tue Oct 31, 2006 3:13 am    Post subject: Reply with quote

Hamish wrote:
Quote:
I think in the hidden treasure trove of blitz commands there's one that lets you draw just a section of an image.


DrawImageRect
Thanks Hamish

The maximum bat size is 410 so your "big bat" image should be 20x360 (because 50 is the end caps)
Back to top
View user's profile Visit poster's website
ewerybody



Joined: 05 Sep 2006
Posts: 165
Location: Berlin



PostPosted: Tue Oct 31, 2006 7:10 am    Post subject: Reply with quote

konedima wrote:
should I take the top, bottom or middle of it to use to make the bat when its smaller than the image?

hmmm... one cannot draw something special in there .. so it actually doesn't matter.
Do whats easier. If its all the same take its center :]
Back to top
View user's profile
Konedima
Grammar Police
Grammar Police


Joined: 25 Oct 2003
Posts: 1068
Location: Sydney, Land of Censorship



PostPosted: Tue Oct 31, 2006 10:45 am    Post subject: Reply with quote

I'm taking the center. The next version ( 0.08 ) is almost done. I'm just preparing the graphics for the other skins (neon is done) and the installer. Other than the graphics updates bats should redraw a bit faster but I can't really test since I never had a problem Smile and the AI will also use super shots.

For the existing skins I'm not going to much (or any) effort to make the new graphics, I'm just resizing the existing ones.

It should be out either tonight or tomorrow night.

Edit: just updated it. Grab it from the website, as always: http://warpong.sourceforge.net
Back to top
View user's profile Visit poster's website
Konedima
Grammar Police
Grammar Police


Joined: 25 Oct 2003
Posts: 1068
Location: Sydney, Land of Censorship



PostPosted: Tue Oct 31, 2006 9:50 pm    Post subject: Reply with quote

As a (though not necessarily the only) new skin for the next version, we have: Monotone!

It's meant to resemble classic pong, and for 5 minutes work, it is pretty bad Smile. Its just a recolouring of the retro war (original) skin with only a couple of other changes. The scores were originally white but that makes it really hard to see the ball, so they were made gray. The menu graphics can be a bit unreadable in situations, so I may have to change them later. It adds less than 50kb to the installer so does not dramatically increase download size.
Back to top
View user's profile Visit poster's website
Johnh



Joined: 06 Sep 2003
Posts: 160



PostPosted: Wed Nov 01, 2006 4:02 pm    Post subject: Reply with quote

*downloads*

Illegal memory address error!

BB doesn't use pointers, does it? Maybe I need to install a dll or something?


I've never used BB before, but going off of what I know about C++, maybe I'll be able to browse the source code and see if I can understand any of this...

*pours over code for 10-20 minutes*

hmmm...

Oh wait, what was that error I keep getting with my own code? It doesn't load the image properly unless it's right in the same folder as the executable? Let's try that out...

*moves executable to default folder*

It works!

Pretty interesting game you have there, a new twist on an old classic. Good job!

A question, though, do you accept constructive criticism? Or would you rather I not go and act all smart and stuff?
Back to top
View user's profile
Konedima
Grammar Police
Grammar Police


Joined: 25 Oct 2003
Posts: 1068
Location: Sydney, Land of Censorship



PostPosted: Thu Nov 02, 2006 4:08 am    Post subject: Reply with quote

Johnh wrote:
A question, though, do you accept constructive criticism? Or would you rather I not go and act all smart and stuff?
Constructive criticism more than welcome! How else will I know whats wrong and how to fix it?

As for the illegal memory address error, it happens far more often than it should. The executable looks for the graphics in the same folder as it is, but because there are multiple skins they can't be in the same folder as it. The solution is to have the "Start in" location of the shortcut the folder of the skin, like:

That generally works, but if the installer makes the shortcuts wrong for some reason (but it shouldn't, NSIS is pretty failsafe) then it won't work. I could include a seperate copy of the exe in each skin folder, but that would increase the install size (and I'm not sure about the installer size, I don't know if NSIS is that smart).

Edit (about an hour later): The next version includes a better skin launching system. The start in will become unneeded, and instead the folder name will be in the shortcut, a la "whatever\war pong 0.09.exe -skin skinname" or whatever. You get the idea, right? Smile. I'm also increasing the flexibility of skins by being able to draw the bat middle from the top, middle, or bottom section of the big bat image. If I'm feeling up to it I might include the ability do draw from each end of the bat and miss the middle.
Back to top
View user's profile Visit poster's website
Johnh



Joined: 06 Sep 2003
Posts: 160



PostPosted: Fri Nov 03, 2006 6:27 am    Post subject: Reply with quote

Alright, constructive criticism time!

I'll do bad news first, good news last, so we end on a positive note.

The only thing bad that I really have to say is about the cosmetic appearance of your source code. Many coders don't put enough emphasis in their coding time to make the code look pretty. The reason for this is because most coders feel that "time spent commenting could be time spent coding!".

Some cosmetic changes that you might want to consider for the future:

1) Put more space imbetween your functions/subroutines/methods/whatever you want to call them. While I was reading your code, I found myself sometimes missing the return statement, and continuing to read code into your subroutines on the bottom.

2) Choose more descriptive variable names. While it is easy to type out shorter names such as "pl1b" and "bdx". Also, try to avoid making multiple variables with similar names. You have on a single line, the statement: "If bdx=1 Then bx = bx - bxs". That's 3 variables, that are very similar to each other, all start with the letter b, and have the letter x in them. Of course, at the same time, you have to avoid choosing a variable name that is overly verbose and takes forever to read and type. Find the happy medium.

3) Document your variables and functions/subroutines/methods/whatever. Makes it much easier for a stranger to be able to tell what it is that a variable is meant for, and it can help him figure out what a variable/routine name means if you could not/did not give it a descriptive name.

4) Double check that your control structures are properly indented, and that all control structures are closed at the proper location. In C++, forgetting to put in a closing bracket is particularly frustrating. I am certain that it is just as frustrating when you forget to put in an ENDIF statement in the proper location...

5) Gotos.... ugh. Gotos can be very flexible. However, they also drastically reduce the readability of your code. Avoid using goto statements, and when you do use them, document their use, so that a person reading your code knows where your program is going, and why. An important reason why you should avoid gotos, is because goto is one of the few features that most programming languages try to avoid. If you ever move to another language, you may discover that goto is not available to you (Gotos are illegal in Java, for example).

6) Avoid the use of "magic numbers". Your code uses a variety of "magic numbers" that make your code harder to read. Your main menu section of your code is especially thick with magic numbers. Replace these with constants. And if BB doesn't have constants (it should), try to see if you can add some comments somewhere that describes what each of the magic numbers mean. For example:

Code:

Select mmselect
   Case 1 ;put a comment here, saying ";player selected a single player game"
      ...
   Case 2 ;put a comment here, saying ";player selected a two player game"
      ...
   Case 3 ;put a comment here, saying ";player selected a two player, fast mode game"
      ...
   Case 4 ;"player choose quit game option"
      ...
   Default ;"player did not make a choice"
      ...
End Select



7) Move more code into functions/routines, to help with self documentation. Not only should you use a function/routine on reusable code, but you should also use it to simplify your main game loop. For example, consider moving your bullet movement and collision, supershot display and collision, bat movement, ball movement, ball collision, etc etc... all into their own function. That way, your main game loop isn't a series of several hundred statements, but only a dozen or so functions.


PROS:
Aside from a few cosmetic changes you could make, your code seems well layed out to me. It was easy enough to follow once I switched from C++ reading mode, to BASIC reading mode.

You clearly comment when your program is transitioning from one "paragraph" to the next. For example, "See if someone got a supershot" "ball movement" "AI bat movement", etc... This made it much easier for me to see what it is you wanted to do, and where.

The program runs smoothly, and is *mostly* bug free. Only bug I noticed was that when your score reaches the double digits, the 1's digit bumps down below the 10's digit. But aside from that, everything worked fine.

Perhaps most importantly, though, is that you program just plain works. The actual content of your code is fine.
Back to top
View user's profile
Konedima
Grammar Police
Grammar Police


Joined: 25 Oct 2003
Posts: 1068
Location: Sydney, Land of Censorship



PostPosted: Fri Nov 03, 2006 7:39 am    Post subject: Reply with quote

Most of your criticisms are valid. The code was written to be read... by me.

It would be a bit of an effort (ok, I'm lazy) to change all the variables but it could be feasible to document all of them.
Quote:
Only bug I noticed was that when your score reaches the double digits, the 1's digit bumps down below the 10's digit. But aside from that, everything worked fine.
I'm not quite sure what you mean here. If you're just looking at the default (retro war) skin (as I'm assuming), then its to do with the skin. Each skin has a file with the numbers 0-21 next to each other so thats probably the skin (look below)

If thats not it, then to be honest I have no idea what you're talking about. Could you please clarify?
For the next version I will try and document the code better (to be honest I never intended it to be open source, its just that sourceforge has free great hosting, so originally the code was written to be read by me).
Back to top
View user's profile Visit poster's website
Johnh



Joined: 06 Sep 2003
Posts: 160



PostPosted: Fri Nov 03, 2006 9:23 pm    Post subject: Reply with quote

Sweet, so it wasn't a bug at all, but a part of the skin.

And if your project isn't meant to be open source, I guess the most important thing is that you can read your own code. So all in all, great job!
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Discussion Pod Forum Index -> Game Talk All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Page 4 of 9

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group