Running commentary/ideas
(Newest on bottom, oldest on top)

Return to main page  |   Submit a comment


Test Entry (Submitted by richprillinger on Fri Nov 2 02:18:19 PST 2001)

Test Entry 1


test2 (Submitted by richprillinger on Fri Nov 2 02:18:33 PST 2001)

Looks like it works


Initial versions posted (Submitted by richprillinger on Fri Nov 2 04:00:05 PST 2001)

I stuck a basic version of gameworms.cpp into the archive to test it, seems to work. Joe & Lee, you guys should add your updated/modified versions of gameworms.cpp to this when you get a chance.


nothing new (Submitted by leegong on Sat Nov 3 00:56:05 PST 2001)

I started working on coding the maze. I hopefully will get it updated by sunday. Looks good so far, Rich.


maybe change order, oldest ones on bottom..? (Submitted by leegong on Sat Nov 3 00:56:43 PST 2001)

just a thought..


Yeah I like that too, but... (Submitted by richprillinger on Sun Nov 4 14:33:02 PST 2001)

Putting the newest at the top was a lot more work. The way it is now it just appends to a file... I'd rather put effort into the project itself.


gameplay, classes, and features (Submitted by richprillinger on Sun Nov 4 16:06:53 PST 2001)

As we discussed, here's material for some slides, 4 on gameplay, 2 on features, and then the class UML. I'm not real great at the UML, but I think this kinda makes sense. The UML is here.


==============
gameplay
==============

Slide 1
--
You are a snake in a garden.
You eat other snakes if you
 are shorter then they are.
You get 1 segment longer when
 you eat another snake
--


Slide 2
--
You eat shorter snakes by 
 running into them head first
You nibble on longer snakes
 by eating their tail
Eat longer snakes by eating
 their tail enough times to
 make them shorter than player 
 snake
--


Slide 3
--
Enemy snakes can sacrifice
 1 body segment to drop an egg
If player snake doesn't eat
 this egg, it turns into 
 another enemy snake on lext level
Player can do this also - if not
 eaten by an enemy, it turns into
 another life on next level
--


Slide 4
--
Game starts out with two snakes, 
 one player and one enemy, each with
 3 segments
If player eats only enemy snake, game 
 moves to next level
Each successive level is populated with
 a new enemy snake, one segment longer
 per level, plus snakes left alive at 
 last level
Levels are time limited, forcing a sense
 of urgency to the player
--

==============
Features
==============

Slide 1
--
Required alpha features

 - one maze
 - player snake
   - head/body/tail segment
 - 1 enemy snake
 - logic between snakes
   fully functional
 - eating/growing/shrinking
   logic fully functional
 - player snake has 3 lives
 - make it beautiful
--


Slide 2
--
Optional alpha features

 - multiple enemy snakes
 - food, enemy eggs, player eggs
 - player score
 - sounds
 - multiple levels/mazes
 - snake/level color choices
 - gameplay speed increases

Also (Submitted by richprillinger on Sun Nov 4 16:58:53 PST 2001)

On page 195 in the class book is some stuff we might be able to use too...


gonna be late.. (Submitted by leegong on Sun Nov 4 17:29:58 PST 2001)

I've got everything written out, but its going to take time to get it entered and loaded - sorry for the delay.


new files (Submitted by leegong on Sun Nov 4 23:52:56 PST 2001)

Note: need 3 files updated: gameworms.cpp gameworms.h popdoc.cpp the first two allow walls, the third sets the worms demo to start. I didn't bother removing code, mostly just commenting out. I've got 3 worms running, but I haven't worked on collisions between worms - I'm guessing there shouldn't be any though.


Gameplay (Submitted by richprillinger on Mon Nov 5 00:31:16 PST 2001)

I played the Ambrosia game of Slithereens tonight for about an hour. Things I noticed that are or could be important to our game:

The player snake moves about 10% faster than enemy snakes
Egg drops are random for both player and enemy and are not player controlled
Snakes have a head and the body segments, no tail
Snakes must have a head and one body segment to be alive
Snakes start out with a head and two segments
Motion is like pacman - once give a direction, the snake continues in that
  direction until hitting a wall or other solid object
Snakes shorter than the player snake are colored off-white - this is a good
  feature that makes for easy ID of shorter snakes
Snakes are viewed from above when travelling up or down the screen, and a 
  viewed from the side when they are travelling left or right.  This gives some
  sort of minimalist visual effect, probably not worth including in our project
Each level starts out with 1000 bonus points, decreases at about 10 
  points/sec.  If level completed before bonus points go to zero, those points 
  are added to player score
There is no time limit on any levels
A snake grows only when:
   - eating an enemy egg
   - eating a piece of random food
   - eating the head of an enemy snake
If the player snake eats the enemy snake mid-body, all body segments from the
  eating point to the tail go away (are eaten)
Player gets 50 points per enemy snake segment eaten
If either player or enemy snake has only 2 segments, the game still randomizes 
  egg drops, killing the snake.  Perhaps we want to not allow egg drops with 
  only 2 segments?
Gameplay does indeed speed up between rounds, but slowly
Each round has both more enemy snakes initially and longer snakes
At the beginning of each round, location of player snake is randomized
If the player snake eats an enemy snake from behind, and eats all the segments
  and the head, the player snake only gets points for each segment eaten, but
  does not gain a body segment.  Remember that a snake needs at least a head
  and one body segment to live, so when the player snake eats the last 
  remaining body segment of an enemy snake, the enemy snake dies and the player
  snake never has a chance to eat the head of the enemy snake.
The Ambrosia version has lots of sounds.  Some are good, others are annoying.

(Submitted by joecheng on Mon Nov 5 16:48:20 PST 2001)

I uploaded a few changes. - Pretty much what i had done in class. - the player is now just a cCritter, can't shoot, this is so the body parts can be set to chase the player - i tweaked the spring-rod force settings alittle, they stick together better


maybe its just me..? (Submitted by leegong on Mon Nov 5 18:42:24 PST 2001)

But I couldn't get the code to work correctly. I got 11 errors, in an area it look like you did (started?) a cut and paste. I've included the relevant code/errors below. void cGameWorms::seedCritters() { pbiota()->purgeNonPlayerNonWallCritters(); /* Clean out any old non-player non-wall critters. Although we don't have walls yet, you might want to put some in. */ /* Make some new cCritterWormsRival(pplayer()) or new cCritterWormsProp and call add() to put them into the game.Here's one way you might do it.*/ /* 11-5 Joe Cheng Don't need this loop, we are not going to have any cCritterWormsRival critters for (int i=0; i<_rivalcount; i++) { cCritterWormsRival *prival = new cCritterWormsRival(pplayer()); add(prival); prival->randomize(cCritter::MF_POSITION); //Need to do cGame::add BEFORE randomize pos prival->setWrapflag(cCritter::BOUNCE); //Can override the wrapflag setting that was made by add. } */ cCritterWormsProp *pprop_prior; /* This is a special trick for the follow-the-leader thing we'll set up in the next loop. Not standard. */ //for (int k=0; k randomize(cCritter::MF_POSITION); pprop_prior = pprop; // } } Compiling... gameworms.cpp C:\Windows\Desktop\Fall 2001\Cs160\Pop 22.6, Oct 12, 2001\gameworms.cpp(161) : error C2065: 'randomize' : undeclared identifier C:\Windows\Desktop\Fall 2001\Cs160\Pop 22.6, Oct 12, 2001\gameworms.cpp(162) : error C2065: 'pprop' : undeclared identifier C:\Windows\Desktop\Fall 2001\Cs160\Pop 22.6, Oct 12, 2001\gameworms.cpp(162) : error C2440: '=' : cannot convert from 'int' to 'class cCritterWormsProp *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast Error executing cl.exe. Pop 22.6(Debug Build).exe - 3 error(s), 0 warning(s) This is after I tried fixing the code ... Anyone else have this problem.?


changes to code (Submitted by joecheng on Mon Nov 5 19:34:40 PST 2001)

I sent new code up, I fixed the errors. What happened was when you uploaded it or edited you remove a few lines of code in one of the loops, probably unintentionally. I'm just sent up some new code some kinda interesting changes:

-  new class called cCritterWormsEnemyHead
      -  dosen't do anything important yet, i figured we need it anyways so 
         might as well just make it now. 
      -  made the new head a bmp of ruckers head, just so we know which one is 
         the head of the snake
-  new function in cGameWorms
     - initiates the player with a tail of snake bodies.
 - other stuff can't remember, its all marked where i changed it.

same error..(?) (Submitted by leegong on Mon Nov 5 21:47:48 PST 2001)

I still have some lines of code disappear. I'm assuming its the same as the original code (ie, cutting and pasting the missing part seems to fix it). I don't know how its being dropped - I don't see it on the website when i look, either. No big deal, my machine has been hiccuping for a while. I need to reinstall everything. So far- it looks good. The worms still get broken up, but maybe increasing the size of them will help. Also, we might want to increase speed, as well.


Played with forces a bit (Submitted by richprillinger on Wed Nov 7 02:25:32 PST 2001)

I spent a little time playing with the forces. I've got a new force defined called cForceObjectLinkRod that I'm using to play with. I think the solution to this problem is going to involve a few things. Give the segments zero mass so they have no inertia, so when the head stops they stop - no wandering.

The solution to the segment loss problem looks like it might be solved two ways, neither of which are pretty:

1 - Have segments follow the exact path their "parent" segment (or head) does. This will involve some sort of temporary memory mechanism. That way all segments are guaranteed to follow the same path and can't get stuck around corners, etc.

2 - Use the rod concept, but limit the angle between segments to something like 20 or 30 degrees. Segments rounding a corner would thus be "swung out" to make the corner and shouldn't get stuck.

Initially, I thought the second idea was the way to go, but the more I think about it, the more I think the first is the best choice. With the first, we could eliminate the notion of a link entirely - just have each segments move in equal amounts along the path that the head followed. Initially each segment would have different offsets from the head to make up the snake. The head would leave a "track" that all other segments follow, moving in equal distances per timestep so that the snake appears to be moving all together. This would also eliminate the vibration that the snakes exhibit.

This is a lot of work... it involves getting the snake object done and implementing a memory system, perhaps in a basic linked list of coordinates no more than a couple hundred nodes long. Each segment of the snake would be proceeding through the list, jumping to each location as it is read. if anyone has thought on this more, please share. I will continue to think on it as well.


Another unrelated comment... I think we'll need to fix the forces that react to the player hitting one of the walls. It's really annoying sometimes to try to get out of a corner when every time you hit a wall or one of your own body segments you get turned around. Perhaps we can just turn off the turning around part.


No code uploaded btw (Submitted by richprillinger on Wed Nov 7 02:27:23 PST 2001)

I didn't upload any of my modified force files since I didn't really get anywhere with it...


start positions of the critters (Submitted by joecheng on Thu Nov 8 23:24:57 PST 2001)

For the start positions of the critters we have 2 choices, right now it is set up that so that each worm is started in a random location, all the pieces are started there, in a pile, they can also be strung out as well. The second choice is starting them in the same spot each time, either choice is fairly easy to implement, purely perference.


i like the random start.. (Submitted by leegong on Fri Nov 9 23:11:49 PST 2001)

maybe we can make it so the player is 'safe' until a certain time passes, or until he moves.. just a thought.


new files (Submitted by leegong on Sun Nov 11 22:52:01 PST 2001)

I've got the code posted that I had running in the lab. Still working on getting just one critter to die, rather than all. Also tried to get arrow controls, but no luck on that. Going to email Rucker about it.


Sigh (Submitted by richprillinger on Mon Nov 12 03:34:27 PST 2001)

I spent a few hours trying to get the memory idea working with no luck. I feel like I barely know what I'm doing with this code... I think perhaps this week I might sit down with him during office hours and try to get something going, or at least type some comments in code where things need to go. I can't recall what and where the notes we made in my notebook on Thursday are supposed to go into the code.

I know I feel like I could do my part better if we had a snake object. Right now I'm at a loss as to how to address the player critter, or any other critter for that matter. Maybe this would be a better place to start with Rucker. I'm not meaning to suggest that this is someone else's problem - I entirely understand that this is difficult at best.

I think a snake object would also make Lee's task easier as well, if we could address the snakes as objects, and their segments as members of those objects.

I dunno, I'm going to bed for now. There's nothing else on my plate for tomorrow so maybe I'll mess with it some more then.

What does anyone else think?


working code(?) (Submitted by leegong on Mon Nov 12 12:42:42 PST 2001)

The snakes eating segments part works - kinda. The player can eat segs for others, but I haven't played with the snakehead part. We do need to keep track of segment numbers. We also need to change controls (I've got that part, I just need to type it in) Rucker is extremely helpful, we just need to chatch him. I can make it tomorrow before class at Rucker's office with you, Rich. We'll see what his ideas are. I really think a more solid force object would work better. The segment eating cost us the movement code I had in the game I posted Sunday and demo'd in class.


Running code (Submitted by joecheng on Mon Nov 12 13:23:35 PST 2001)

I have gotten the eat one segment to work, and my movement code is still intact. The way I did it was in the player's collide method. It works with only 2 lines of code, the problem is that is that I had to add a class to make it work, a player body class, to differentiate the player from the enemy. The problem is that you can eat the middle of a snake and break it apart. I also came to the point where it is almost necessary to create a snake class. I just took a look at your idea Lee, and I like it better. So I'm going to put my idea aside and work with yours. I'm going to encasulate a snake class, and see what that looks like.


re: what I did (Submitted by leegong on Mon Nov 12 13:50:58 PST 2001)

I also added a player segments code. I think if we have 3 different counters, 1 for each snake, and 1 for the player's length, we may be able to skip the snake encapsulation. Keep working on it though - in case what I am conjuring up doesn't work. I've got a midterm Wed and quiz Thurs, but I should be able to get some more of it out to you guys by tonight. I think my snakes can be 'eaten' from the middle as well, but if the counters are used, I'm hoping that will fix it. We'll see.


No more broken snakes! (Submitted by richprillinger on Mon Nov 12 19:23:23 PST 2001)

I managed to get a non breaking snake force working. You'll need to update force.cpp and force.h as well as the gameworms.cpp/h. I set the default player snake to a longer length - I played with it for a while and couldn't get it to break. It's a force but it behaves like memory. Sometimes the tail segments cut through corners of walls, but it's not that noticable.

I also cleaned up gameworms.cpp, I could hardly stand it as it was.


eating snakes, growing, and encapsulation (Submitted by joecheng on Mon Nov 12 19:30:21 PST 2001)

I have encapsulated the snake class and incoporated it into the 
code with very few major changes, atleast nothing that should 
affect anybody elses code.  

With the encapsulation I can not eat the middle section of the snake
anymore.  When a section is eaten the players snake grows as well.

We need to give the enemy snakes some time after they get eaten in which 
they are invincible or you just end up eating the entire enemy, i don't 
know how to do this so I haven't done it.

The code will be up shortly

(Submitted by joecheng on Mon Nov 12 19:32:49 PST 2001)

Rich i just notice what you posted after i posted mine. Can you send up your code so I can match everything up. I hope of code matches up fine.


Actually... (Submitted by richprillinger on Mon Nov 12 19:34:15 PST 2001)

In what I just posted, it looks like the body segments are not colliding with the walls. I'm thinking this is OK behavior, if we can get the segments to stop pushing the head around and bunching up when the head stops. That's the only circumstance I see where it looks kinda bad.

I'd be interested to see if the LinkRod force lets the snake break apart if the segments are set to collide with the walls... or not, whatever works. :)

Thoughts?


Joe, code is posted (Submitted by richprillinger on Mon Nov 12 19:35:59 PST 2001)

The code I did is online now...


My eating snakes code (Submitted by joecheng on Mon Nov 12 19:51:47 PST 2001)

I'm going to send my partial code up as well, bear in mind that I haven't combinde our code yet, snakes are only eaten from the tail or middle, but when eaten from the middle only the tail disappears. When you eat a section the your snake grows.


I hope our codes integrate well, that would put us well on the
way to completion.

Bad news (Submitted by joecheng on Mon Nov 12 21:35:04 PST 2001)

Sorry guys got some bad news. Rich the code that you put up was still using the original spring-rod force for the players sections, the player snake body sections are defined in the class cCritterPlayerWormsSeg, and in the code you put on the web you didn't change that part of the code at all, you changed the behavior of the enemy snake segements.

Unfortunately when I put the linkrod force into the players code the worm esentially becomes a long rod that just floats in basically the same shape as it was when it was set up.


Hm, it works for me (Submitted by richprillinger on Mon Nov 12 23:29:20 PST 2001)

The code I changed DID change the cCritterWormsSeg:

cCritterWormsSeg::cCritterWormsSeg(cCritter *pcritter) /* Lee added 11-11-01 */
{
	setSprite(cGame::RANDOMSPRITE(cGame::ST_BUBBLES)); /* Lee added 11-11-01 */
	setRadius( 0.7 );		/* 11-6 Joe */

	if (pcritter)
		addForce(new cForceObjectLinkRod(pcritter,		// changed to LinkRod force 11/12/01 -Rich
			1.0));//,		// distance between critters	/* Lee added 11-11-01 */
			//1000 ));	// springiness force			/* 11-5 Joe Cheng */
}
(You'll see this in the uploaded gameworms.cpp... make sure you're compiling the newer version (or whatever else might be wrong)).

I did something where, at one point, my game was exactly as you described... if you're trying to integrate code, make sure you are changing the force in the correct function. I tried changing it in different one (don't remember which) and I got exactly the behavior your described.

Double check that you've modified the right function... that's what this sounds like to me.


laptop (Submitted by richprillinger on Mon Nov 12 23:31:39 PST 2001)

I'll bring my laptop tomorrow and it will have what works for me on it...


class notes (Submitted by richprillinger on Tue Nov 13 14:20:29 PST 2001)

Overload enemy heads with collide() method
Combine code and make both features (eating, no breaking) work
Make enemy snakes move all the time with some intelligence

where i am now (Submitted by joecheng on Wed Nov 14 01:36:37 PST 2001)

Both collide methods work, the player and the enemy head. I still think that we need to give the snake being eaten some time of invinciblity( haven't gone there yet). I think i have the eat logic down, player eats enemy tail, gains segment, enemy shrinks; player eats enemy head, enemy dies, player gains 1 segement; player runs into enemy head with longer tail, player dies, the logic for this one currently is game over, can be changed to losing life or what not. I am working on dropping eggs, and inserting random critters as "FOOD". Not quite "cake" but not to difficult.

Some interesting behavior that I am noticing with the spring rod forces:
- when a critter get "stuck" on a wall or what not, I don't think it is really "stuck". So the just the sprite is stuck not the snake.
- I think that the system still process the snake as if it was still connected as it should be. The reasoning behind this is that when you try to eat a piece of the snake that is "stuck" you can't, you have to eat the snake part where the segment SHOULD be.
- Maybe with a little tweaking the spring rod force could yield the exact motion that we want.
- Just an idea, if we can't get the code integration to work right.


cool (Submitted by richprillinger on Wed Nov 14 12:34:45 PST 2001)

Cool, sounds good Joe. I'll try to integrate the code tonight... it'll probably be pretty late, after 10 pm I'll start working on it. I have other stuff to do before then.


increasing radii? (Submitted by leegong on Wed Nov 14 13:49:10 PST 2001)

I'll try playing with how 'big' the critters think they are. Maybe that will help . I'll also get a chance to play with the code tonight as well. It sounds pretty good though. One question: what version of pop code are we using? I've got 22.6 and 22.8 and I can use either. I think they both work about the same. We should have a consensus of what we're using, and we'll want to get a working model of the whole thing by (I'd guess) Sunday night, and tweak it Monday for an in-class presentation Tuesday. Any thoughts on that?


"food" (Submitted by joecheng on Wed Nov 14 15:35:26 PST 2001)

I'm using 22.8 right now. How detailed of a alpha do we want running for the demo? Currently the code I has the critters dropping eggs, after a random amount of time. We need to go over the behavior of what happens to get eggs at the end of the game, I don't know, so the game just ends when all the other critters are eaten.

Does anyone mind if I use the Player class to insert "random food items"? If I don't use the player class I have to create a new critter that would be permanently off screen to generate the "food".


Sounds good to me (Submitted by richprillinger on Wed Nov 14 18:04:43 PST 2001)

Yeah, go for it joe, in regards to using the player class. If you could, upload your latest code so when I mess with it later I'm using your latest version.

I also agree with Lee on getting a working alpha. I think we're pretty close.


latest code (Submitted by joecheng on Wed Nov 14 19:12:08 PST 2001)

I just put up my latest code, it is not documented terribly well, and you might have to comment out one of the defines at the top of the code, specifically comment out "#define NOEGG" that ya you get to see the egg code, it is set to drop eggs fairly quickly, just to demo the idea.


Hrm (Submitted by richprillinger on Thu Nov 15 00:29:27 PST 2001)

Well I think I know why my force acts differently in Joe's code than mine... in the updated code Joe has, the player referenced as a new cCritterWormsBase class:

cCritterWormsSeg::cCritterWormsSeg(cCritterWormsBase *pcritter)
And in my code, it is referenced as a cCritter:
cCritterWormsSeg::cCritterWormsSeg(cCritter *pcritter)
So the problem now is that I want to just change the force to use the variables we created in the cCritterWormsBase class instead of the plain old cCritter vaiables, but cCritterWorksBase is an overloaded class, and is out of the scope of force.h/force.cpp.

I tried putting the LinkRod function directly into gameworms.cpp/h but there are too many variables that cForceObjectLinkRod inherits from cForceObject to make this feasable... I mean, we could combine force.cpp with gameworms.cpp and force.h with gameworms.cpp to solve this, but that's ugly.

Not sure what to do... 149 homework awaits.

On a more positive note, the logic seems to work pretty well. I didn't really see any eggs dropping with the new code though... and I got one assertion error when I (I think) ate the middle of an enemy snake and then ate it's head. Not sure... kinda hard to tell with the motion the way it is now.


cleaned up versions of gameworms.cpp/h posted (Submitted by richprillinger on Fri Nov 16 02:53:38 PST 2001)

I hope the tab formatting didn't get screwed up when I pasted it in... it looks like some of it might have, but it might fix itself when you paste it back into Visual Studio.


forces (Submitted by richprillinger on Mon Nov 19 21:08:05 PST 2001)

I dunno if you've played with the forces Lee, but I've been finding that with a large enough radius the snakes don't seem to break up with the SpringRod force. I've made some sprites and set the radius to 1.0 and they aren't breaking...

Anyway I'm playing with that and working on the user doc stuff. I'll get it done late tonight and posted.


UML (Submitted by leegong on Mon Nov 19 22:33:22 PST 2001)

Actually, I haven't touched the code in a bit. My gf's cold decided I'd be a good place to stay, so I've been feeling pretty ill. I'll send the UML out a little later. I've got it on paper, just going to put it on comp first. I thought I'd have time to play with the collisions and radii of the critters, but no such luck.


presentation and alpha build (Submitted by joecheng on Mon Nov 19 23:09:08 PST 2001)

I like both of you haven't really had a chance to hack at the code this weekend. I'm pretty beat, this semester is kicking the crap outta me, so I just took the whole entire weekend off. I rearranged some of the code to make it more ... well organized. I'm just going to build the code that I have now, and use that for the presentation, we can mix and match our code later.

I have 2 midterms to tomorrow, so back to studying, I'll look at all your guys stuff tomorrow.


Played with some more stuff (Submitted by richprillinger on Tue Nov 20 02:45:05 PST 2001)

I created a greenish textured background for use as our garden, and have created an IDB_PLAYERSNAKEHEAD, IDB_PLAYERSNAKESEG, IDB_ENEMYSNAKEHEAD, and an IDB_ENEMYSNAKESEG. It looks a bit better. I tried pulling a bitmap from an actual picture of a snake, but when reduced to the size needed in our game, it just looked like a tennis ball. I took it back out, but the bitmap is included in the latest upload if we want it later.

There is a frog bitmap online too... I don't remember what it's for but it's there :) I think you just need to put the .bmps into the res directory and update your pop.rc file with the one I uploaded, along with the usual gameworms.cpp file (I didn't update gameworms.h). I'll try to stick a screenshot online too.

I've emailed Rucker about changing the walls, as I can't even get the fill color to change, despite changing every instance of CN_LIGHTGRAY in the entire framework(!). I'd like to change the fill color and bordercolor to darker shades of green, and if possible, "roughen up" the wall borders so they look more bush-like. I dunno if this is reasonably possible or not.

I also emailed Rucker about changing the focus circle size - the focus circle is the circle of influence the objects used in collisions. I messed with the the code for this to try to get the focus circle size to agree more with the sprite size, but got nothing -- It always scaled with the critter Radius. (An outline of the focus circle can be seen with the arrow tool.) If this is easy to fix, this may also help in the snake breaking problem. But it's mainly just annoying since things happen (aka collide()) when objects aren't touching visually. Awaiting a response.

Also, the beginnings of the user guide are online in a new section.


looks good. (Submitted by leegong on Tue Nov 20 10:00:04 PST 2001)

I've modified the users guide slightly (adding features that I think we can put in). I'm playing with the game now - Just for the alpha demo purpose. I'll get a chance to modify the code over the break.


Interesting stuff (Submitted by joecheng on Tue Nov 20 22:45:02 PST 2001)

I changed around the collide code so that the snakes body parts no longer collide with the head. So the head no longer gets pushed around. Like I told rich earlier, on the plust the head no longer gets pushed around, on the downside, there are no forces acting on the enemy heads now so they don't move anymore.

What is next on my list of stuff to do? I was gonna take a crack of the movement thing, only 90 degree turns. Someone needs to post or email me what Rucker said to do though, I didn't take notes on it. Anyways, is there anything that I should look at before I take a crack at the movement?

Oh ya, I'll post the code later tonight.


visual stuff (Submitted by richprillinger on Wed Nov 21 15:10:40 PST 2001)

I'll post the code shortly for the changes I made in class on Tuesday. I'm thinking I probably won't work on this much, if at all, until maybe saturday or more likely sunday, maybe even monday :) I want a few days away from everything.


Changes, etc (Submitted by richprillinger on Wed Nov 21 15:38:30 PST 2001)

Rather than uploading all the files just for the minor changes in them...

In colorstyle.h, in the cColorStyle class definition, add the lines:

        static const int  CN_NOTASDARKGREEN;    //Rich
        static const int  CN_DARKGREEN;         //Rich

In colorstyle.cpp, in the color constants section, add this:

  const int cColorStyle::CN_DARKGREEN = RGB(30, 100, 30);       // Rich
  const int cColorStyle::CN_NOTASDARKGREEN = RGB(45, 125, 45);  // Rich

In critter.cpp, in the drawHighlight function (bottom of the file), change the first half of the function to this:

        Real focusradius = (highlightsizeratio * radius()) / 1.8; //Rich
        cSpriteCircle focuscircle;
        focuscircle.setFilled(FALSE);
        focuscircle.setLineColor(cColorStyle::CN_LIGHTGRAY);
        focuscircle.setRadius(focusradius);                      // Rich
        focuscircle.setPrismDz(0.0);

In critterwall.cpp, add these three lines to the end of the CritterWall constructor with 3 arguments (not the default constructor):

        psprite()->setFillColor(cColorStyle::CN_DARKGREEN);          // Rich
        psprite()->setLineColor(cColorStyle::CN_NOTASDARKGREEN);     // Rich
        psprite()->setLineWidthWeight(0.04);                         // Rich

And finally, in sprite.cpp, add/change (I don't remember which I did) the line in the default cSprite constructor:

        _radius = (cCritter::MINRADIUS + cCritter::MAXRADIUS) / 2.0; //Rich


I'm pretty sure that's everything... if someone wants to play with tweaking this part of it before Sunday, that's cool. But otherwise I'll just keep working on it, but not until Sunday or Monday.

Happy Turkey Day!


Oh yeah, one other thing (Submitted by richprillinger on Wed Nov 21 15:44:50 PST 2001)

I played with the focus circle size a bit in class on Tuesday. but even when it's the right size for the sprite, collides seem to happen prematurely. I'll play with this more later too.


colliding critters and focus circle (Submitted by joecheng on Thu Nov 22 16:00:57 PST 2001)

To take care of the colliding critters colliding prematurely we would need to overload the getRadius() or radius() or what ever the function is to get the sprites radius, we would just need to reduce the size of the radius that it returns. If that is too much trouble I could just deal with the sizes of the critters in the collide methods, it just as easy either way.

Sorry about not posting the code I forgot, I'll make Rich's chanes then upload the files.


no new code? (Submitted by leegong on Sun Nov 25 23:31:23 PST 2001)

I watched the site Sat and Sun, with no new code posted. I haven't had much of a chance to play with the code though. I want to see how Joe did the scoring.


Finally... (Submitted by richprillinger on Mon Nov 26 17:46:39 PST 2001)

Hey guys... sorry this has been unavailable for so long.

The problem was 4 blown capacitors on the motherboard, NOT the ISP as I thought... the machine would be on for about 30 seconds, enough time to almost boot, and then die. And repeat, over, and over and over.

Anyway it just got a heart transplant and is back online... older hardware but it works. Sorry this thing was down for so long.


By the way (Submitted by richprillinger on Mon Nov 26 19:22:59 PST 2001)

I haven't done anything to the code since last class and last code commentary... I meant to but just didn't get to it.


Sorry Guys (Submitted by joecheng on Mon Nov 26 22:01:58 PST 2001)

Hey guys, I'm terribly sorry I haven't gotten the code up. I've been terribly busy these last couple days. I'll bring the code to class tomorrow. I've played with a couple of ideas and none of them have turned out terribly well, I'll explain in class tomorrow.


code part deux (Submitted by leegong on Mon Nov 26 23:22:15 PST 2001)

Yea, my code-playing hasn't turned up much either. I still have that lingering sickness thing going, which doesn't help. I still want to take a look at the code you did, Joe - that may help me


Things to tweak (Submitted by richprillinger on Tue Nov 27 13:51:59 PST 2001)

as discussed in class, the current fix-it list:

Fix motion so that enemy critters seem smarter
Make player snake move slightly faster than enemy snake
Add sound upon eating enemy snake head (perhaps toggle on/off via menu?)
Make multiple player lives feature work
Make scoring work
Play with/adjust dialog boxes at end of game (something other than 
   just "Hit enter to start over")
Joe will create master files and upload them so we're all working off same code. I'll try to work on the documentation some more and play with the pretty stuff too, although I think we're OK with what we have.
oops (Submitted by richprillinger on Tue Nov 27 14:17:03 PST 2001)

In my list of changes I listed above I forgot some stuff.. just use the latest gameworms.cpp that Joe will upload, that has all the changes in it.


rucker modified files up (Submitted by richprillinger on Tue Nov 27 14:51:02 PST 2001)

Subject says it all


My stuff (Submitted by joecheng on Wed Nov 28 10:29:11 PST 2001)

I just put up my current copy of the code, it has the changes to fix the critters breaking up when they are placed. Basically I didn't "fix" the problem, I went around it, I made an array of cVector2 that stores some "safe" starting locations and starts the critters randomly at them. I'll finish up the code for Thursday, its almost done.


had problems getting new code to work (Submitted by leegong on Wed Nov 28 19:39:45 PST 2001)

it was not enjoying the critter.h file. Any thoughts why?


Code worked for me (Submitted by richprillinger on Thu Nov 29 00:38:40 PST 2001)

Excellent, looks like you did a couple things Joe. Players can go back onto their own bodies (turn around), and the head stops. You turned off collisions though in the code you uploaded, so nothing happens :)

The code you did looks really really good actually. I tried setting up a 25 segment snake and it just didn't want to break no matter what I did. It moves as if it has memory... did you change anything having to do with the SpringRod force? It doesn't look like it.

Very good. So good in fact I think we can just use it as is. Not that I'm trying to be lazy... but if it works when why mess with it?

If we turn on the other critters and turn collisions back on with Joe's code it seems we could put closure to the motion part of the game... except for the enemy snake AI. (That would be really nice) Then we would just have to get the scoring working, the multiple lives feature working, and add any sounds we want... and then try to add more levels if we feel up to it :)

I changed the dialog boxes... nothing fancy, but it's in the game.cpp which I uploaded.


Heh, something funny (Submitted by richprillinger on Thu Nov 29 00:46:22 PST 2001)

I was playing with the game a bit... if you get the player snake moving with one hand, and get the pin(death) tool in the other hand with the mouse, and you kill a middle body segment of the player snake, the remaining body segment just moves off the screen in whatever direction it was last moving... bye bye. Hehe this hardly matters since we're not going to have the pin too enabled in the final release, but I got a laugh out of it.


new stuff.. (Submitted by leegong on Sun Dec 2 08:50:54 PST 2001)

I'll add player lives soon. Hopefully adding it to the info along the bottom will be easy. I also want to put in color change for the beta, as well. We'll see. Right now, I'd settle for a clear head, and some rest. Code posted today or tomorrow.


Hey y'all (Submitted by richprillinger on Mon Dec 3 03:42:29 PST 2001)

Are we supposed to present a beta version on Tuesday? Do we need to print out anything or bring anything to turn in?


Not Tuesday, Thursday. (Submitted by leegong on Mon Dec 3 09:13:37 PST 2001)

I need a nap


new code (Submitted by leegong on Tue Dec 4 12:30:40 PST 2001)

I'm lazy - bringing in new code on CD. I've got the color change to work (ie, when our snake is longer) but the lives part isn't working yet. Also, the code erases the score after all the critters die, rather than just reseeding the game. Currently, losing a life results in (I think) a complete restart of the game.


new stuff (Submitted by leegong on Tue Dec 4 17:52:48 PST 2001)

froggi bmp has been added - runs around, helps with the egg collection. Still fairly random. Egg drop needs to have its time increased. Worm creation from egg needs work as well. Lives still screwy, but I think I can fix that. Rich is working on the new mazes, and Joe's doing more of the coding. Just spewing forth random stuff. Anyone else see something that needs to be done?


New maze, and a couple bugs (Submitted by richprillinger on Wed Dec 5 00:08:48 PST 2001)

I created a second maze... not real great but whatever, it works. (See files section for code, called newmaze.txt). I had to change one entry in Joe's startLocations array so that new worms don't start out broken: Change startLocations[17] to:

startLocations[17] = cVector( -9, 8);
That's it...

Bugs, etc:
There is no "tada" sound when you die from being eaten by a longer worm head on, the sound only comes when you are eaten from behind and die. No big deal but it should be consistent.

When you go from one level to the next, the player on the new level is always one segment shorter then at the end of the previous level. They should be the same.

Also (and this is not really our fault) the wall border thickness seems to be directly related to how long the wall is. Just a comment, not that important.

It seems like there was more... but that's all I remember.


still feel awful (Submitted by leegong on Thu Dec 6 10:59:41 PST 2001)

added secondary maze - initially, the maze fails to load properly on start-up - the player segments also fail. A reset fixes this - no idea why inital fails, but reset works. Quick fix is to add a reset in until otherwise - For the demo today, at least. Lives still fails (sorry).


in class lecture (Submitted by leegong on Thu Dec 6 13:50:46 PST 2001)

my.doc


in class lecture (Submitted by leegong on Thu Dec 6 13:53:28 PST 2001)

if it doesn't make any sense, don't worry. pg 236 my.doc save as my.rtf help workshop add topic


Left to finish (Submitted by richprillinger on Thu Dec 6 14:42:05 PST 2001)

Lee: Lee is working on the egg hatching code. Lee will also add some minimal sounds to the game, and maybe mess with the die sound so it's consistent.

Joe: Joe is going to fix the effective radius of the heads so that collisions appear more natural, i.e. collisions only happen when the actually touch. Joe is also working on the code for the player lives.

Rich: I'll work on game graphics. Since our theme changed I'll change the background colors to more look like tequila and stuff. I'll mess with wall corner roundness to see if we can get it to look better too. Also I'll mess with the frog (shrinking bitmap size possibly), and create egg graphics, etc. I want to make it pretty.


Let's see if we can get a dialog box between levels too... ok cool.


new graphics, etc (Submitted by richprillinger on Thu Dec 6 19:01:44 PST 2001)

Do these steps, in this order to include the new bitmaps and update the old ones:

First copy the bitmaps into the res directory, then... I had the best luck with adding bitmaps via the "Insert | Resource | Import" menu items. Repeat for each bitmap, changing the name of the 'IDB_*' each time to match the filename. The end result should be:

IDB_PLAYEREGG with path "res/playeregg.bmp"
IDB_ENEMYEGG with path "res/enemyegg.bmp"
IDB_FROG with path "res/frog.bmp"
IDB_TEQUILA with path "res/tequila.bmp"

In gameworms.cpp, change the one occurance of IDB_FROGGI to IDB_FROG. Also, change the one occurance of IDB_SUN to IDB_PLAYEREGG, the one occurance of IDB_EARTH to IDB_ENEMYEGG, and the one occurance of IDB_GARDEN to IDB_TEQUILA.

Update cCritterWall like so:

cCritterWall(enda, endb, thickness)
{
   setFixedflag(TRUE);
   setThickness( wallThickness );

   psprite()->setFillColor(RGB(175, 145, 120));		// greyish red, Rich
   psprite()->setLineColor(RGB(205, 145, 120));		// reddish border, blends well, Rich
   psprite()->setLineWidthWeight(0.01);                 // Rich
}
and that's it. No need to worry about the colorstyle.* files this time. Also, I changed the wallThickness from .8 to .6. .8 seemed really heavy looking to me.

Lemme know what you think of the new look... .bmp files will be uploaded momentarily, and I'll upload the edited gameworms.cpp as well (it's based on the version Lee gave me today in class).

I didn't modify the wall border thickness (large thickness make the corners rounded) becuase the border thickness seems to be a number that's multiplied by the length of the wall, causing some borders to be really heavy and others to be really thin, and the overall effect just looked crappy.


oh yeah (Submitted by richprillinger on Thu Dec 6 19:11:29 PST 2001)

I'll change the user doc later to reflect our new theme. Booze.


Dunno if this is intentional or not (Submitted by richprillinger on Thu Dec 6 19:17:24 PST 2001)

But it's cool...

The Frog eats enemy eggs so it can be a help to the player. However, enemy worms can eat the frog and make it go away. Also, the player might want the frog to eat for more length.

Adds an interesting element of strategy.


health and other crap (Submitted by joecheng on Mon Dec 10 19:23:22 PST 2001)

Hey guys, Sorry I haven't posted any of the code I've been working on. I have the lives part working, but I had to make some pretty big changes in the code. I'll just bring the code in to class. I am using the "health" variable for the lives, just incrementing and decrementing it. Rich, all the stuff you mentioned was intentional, I though thats the way the orginal game played so I rigged it up like that. Again, sorry I was so slow with the code.


some more stuff to do before Monday (Submitted by richprillinger on Tue Dec 11 14:01:23 PST 2001)

- 2 program icons
   resources
      Icon IDB_POP
          edit both imagemaps
- Add .hlp file to project
The final is monday the 17th, 12:15 pm
newstuff that still needs to be added (Submitted by leegong on Tue Dec 11 19:41:19 PST 2001)

fix worm spawn code (joe says done)
fix egg code (eggs no longer show up)
fix code so players losing all segments loses life, not ends game
add level counter and use to increase worm size each new level (makes game harder)
add primary AI - or code to limit AI (ie not so intelligent AI)
add new mazes? (most likely not)
POST NEW CODE - just for Joe =)
actually work on code - just for me!


code (Submitted by joecheng on Wed Dec 12 11:18:58 PST 2001)

Code will be up this evening, my laptop battery is outta juice, and my brother has my charger.


Code (Submitted by joecheng on Thu Dec 13 14:18:40 PST 2001)

The code I have it up, I haven't fix some of the stuff yet, specifically the dying when losing all segments part, I'll do it later and post the changes, it should be just a small segment so I wouldn't post the whole code just the segment i changed


icons (Submitted by richprillinger on Fri Dec 14 02:52:29 PST 2001)

I have a final tomorrow but it should be over at 1:30 or 2 or so... I'll do the icons after that and post them.


egg code? (Submitted by leegong on Fri Dec 14 07:29:38 PST 2001)

I saw an egg for a split second - I think the code replaces them right after (ie they die in no time) - I'm not sure, but the eggs, or new baby snakes, seem to be randomly generated. I'll look into it. No progess yet.


Sorry again (Submitted by joecheng on Fri Dec 14 14:42:22 PST 2001)

The newest version of my code is coming up now, I couldn't bring up the server to post it last night. The eggs work properly now


Pop.ico posted (Submitted by richprillinger on Fri Dec 14 15:22:37 PST 2001)

You'll have to right-click on it and save it to get the small icon out of it. If you just click on it it shows you the big icon. I would imagine just replacing the Pop.ico in the res/ directory with this would do it.


error in scorekeeping (Submitted by leegong on Fri Dec 14 23:39:49 PST 2001)

changed: bitmaps - correct tequila schema, as well as egg bitmaps and wall thickness added: level count added: +1 lives (health) per egg per level noticed: score doesn't carry over - I think its a level reset, rather than reseed which causes it. timing still needs to be tweaked. Good job on the egg hatching code. I like the new icon - if you change your popdoc.ico, you get the new icon. I'm not sure why it changes in one place, and not on the smaller pic.


oops - use new code at own risk (Submitted by leegong on Fri Dec 14 23:47:22 PST 2001)

looks like I screwed up the code, too - 2nd level is void of walls I'll post again when i figure out what i did.


new code (Submitted by leegong on Sat Dec 15 20:30:21 PST 2001)

okay, added some stuff so the levels aren't 'broken' - much.
The score no longer carries over.
The lives increment not by one, but add to the default, and gives all those. I'm working on fixes.

lives and enemy snake length (Submitted by leegong on Sat Dec 15 22:20:23 PST 2001)

lives work
enemies are now longer for each level. This also increases lag and causes breaking of snakes. I still think we need to leave it in.

PROBLEM: Building a release version, I'm not able to 'eat' eggs, or frog, or other snakes - the collide isn't keeping up(?) - The debug works fine, but the release gave me problems. Check this on your systems, please!

scoring still broken. Anything else is still - not working 100%? Try it with the new code, tell me what you think.


Looks good actually (Submitted by richprillinger on Sun Dec 16 14:18:41 PST 2001)

I don't get the collision problem when I build a release build vs. a debug build. The release build is significantly faster than the debug, at least on my machine (more than twice as fast). Even the 3d version of the release plays well - 30 updates/second at the default window size. I did find for the 3d version that to display the background bitmap correctly, you have to select "no backgorund" and then reselect "Bitmap background" to get it right. Whatever, not important. It looks good and plays well.

The only "bugs" I see, and these aren't really fatal, are:

  Should fix
  -Rate of enemy egg dropping too high  (Easy to fix I'm sure)
  -Scoring not preserved between levels
  -We need to put our names in the window box header (replacing 
   "Pop, Version 22.8, Nov... Rudy Rucker" with "Tequila Worm" and
   our names... or something.  
  -Disable all the unneeded tools in the toolbar, including the shape tools
   (Try clicking on them  :)

  Less important
  -If the player worm is eaten tail first and dies, two "Get ready
     to be incarnated" dialog boxes appear, not just one.  Only one
     appears when you are eaten head first.
  -The number of lives don't seem to be consistent when starting a new
     game after losing (Seems to be 3, but when you first run it it's 2).
  -Do eggs hatch with one body segment or two?  Doesn't seem consistent, 
     but it's fine the way it is.
I think this looks really good. Who is going to add the .hlp file and get the final product assembled for turn in, including documentation, disk, etc?
by the way (Submitted by richprillinger on Sun Dec 16 14:20:55 PST 2001)

I'd be happy to assemble all the stuff into the form we're turning in... I'll be out for a bit tonight but can certainly get it done.


Menus (Submitted by joecheng on Sun Dec 16 20:00:22 PST 2001)

I have managed to clean out all of the menus, i.e. black out all the other games and other annoying features we don't use. I fixed to scoring problem, and the egg timing.


Clean up his framework (Submitted by joecheng on Sun Dec 16 20:33:32 PST 2001)

If you are interest, in addition to cleaning up the toolbars and menu items I was able to clean up (read: remove) alot of the garbage files that we don't need, i.e. all the other games, resources bitmaps. I'll post the files that need to be changed, its just gonna shrink the size of the executable and files we have to turn in, no big deal. Just an idea. It really shrinks things down, my release file is at 860kb right now. I just posted gameworms.cpp, .h, popdoc.cpp, .h, popview.cpp, and pop.rc.

Rich I also emailed you all the files in a zip file, that is everything I have done up to now, will everything non essential deleted.


cool (Submitted by richprillinger on Sun Dec 16 21:19:06 PST 2001)

I never got the zip file, but that's OK, the changes you made worked when I plugged them in. I'll go ahead and add the .hlp file and get it all on disk for final submission... I think I'll burn a CD too just in case.


My final revision and bugs I can't fix (Submitted by joecheng on Sun Dec 16 21:31:48 PST 2001)

Ok, my final version of code is going up. I made a couple of game play tweaks, mainly you didn't get your lives back if you reset the game after losing one of them, I fixed that.

The stuff or rather thing I couldn't fix.
After alot of tweaking and guess, I still couldn't fix the problem with the collide, and that stupid little focus circle. If I reduced the radius too much the game would go crazy and you wouldn't be able to eat anything and the mmovement went nuts. I shrank it as much as I could with out killing the game play. I think the problem lies within the framework, not our code.


adding sound (Submitted by leegong on Sun Dec 16 21:41:56 PST 2001)

I'm still adding sound. Joe, if you get a chance, take a look at the
score code. I couldn't get it to carry on over different levels.


score (Submitted by joecheng on Sun Dec 16 21:48:46 PST 2001)

Lee, I fixed the scoring already, not a problem. You need to add an int before you initialize the new player to store the score, and call pplayer()->addScore( score ); after you initialize the player. When you call initialize player a new player is created and the old one is deleted and none of the values are kept so you have to do it your self. I hope your using my latest verion of code, I fixed all the bugs that Rich mentioned except for the double reicarnation menu, I know what the problem is for that one and there is nothing we can do.
On a side note, The release version run at 59 updates as opposed to 21 in debug, wow what a big difference.


comment code, add sounds (Submitted by leegong on Sun Dec 16 22:05:57 PST 2001)

I have the latest version now, Everything (except AI) works.
Looks like we're all working on the code. I'm going to finish adding a
few sounds (not many) and also adding some comments into the code. I don't
know what Rucker expects, but I'd guess he wants it commented. Who's doing 
the hlp file?

.hlp file done (Submitted by richprillinger on Sun Dec 16 22:57:18 PST 2001)

It's *not* intuitive at all how to do the help file and use the help compiler... it's lame. Anyway I've got it working. I used the version of the user's guide that was online as of about 10:30 to build it. Lemme know if this changes and I'll rebuild the .hlp file.

Getting's joe's latest code and trying it...


Jeezus (Submitted by richprillinger on Sun Dec 16 23:03:45 PST 2001)

With Joe's latest code I've gained 5-8 updates/sec... heh, what did you do?!? Excellent.

I also updated the help menu in the pop.rc file to use tequilaworm.hlp instead of pop21.hlp, in addition to changing what the actual pull down menu says.


Where the updates came from (Submitted by joecheng on Sun Dec 16 23:35:35 PST 2001)

There is so much garbage laying around in there. I took out as much of it as I could, you can delete all of the game files (.cpp and .h) except gameworms.h, .cpp(obviously) and gamedefender3d.h and .cpp. You can also remove all the bitmap resource files that we don't specifically call.
Lee, I'm done touch the code so unless something goes down the tube before I go to be I'm not going to change anything.
Rich I will try to send you the zipped up stuff I have, then you can see how much I really gutted his code.


sounds tonight? (Submitted by richprillinger on Mon Dec 17 00:04:48 PST 2001)

Lee, are you planning to do the sounds tonight?


ok I guess not (Submitted by richprillinger on Mon Dec 17 01:29:33 PST 2001)

I'm going to bed, I'll get up at a decent hour and assemble it all.


Uh... (Submitted by richprillinger on Mon Dec 17 10:01:13 PST 2001)

Hey Lee, if we're gonna add sounds then you better upload them really soon, unless you want to turn it all in. I've got the user guide printed out... but I haven't uploaded the .hlp file and the changes I made to include that.


upload sound? (Submitted by leegong on Mon Dec 17 10:23:39 PST 2001)

How do I? sorry I didn't get the new code up last night, but I'm 
still fighting my cold. One of the sound files is big, but I thought
it was pretty appropriate.

email (Submitted by richprillinger on Mon Dec 17 10:29:55 PST 2001)

email it to me, that's what I meant... along with the modified gameworms.*


sounds....? (Submitted by richprillinger on Mon Dec 17 11:07:51 PST 2001)

I gotta leave for school in like 10 mins. Gimme sounds!


OK well (Submitted by richprillinger on Mon Dec 17 11:13:34 PST 2001)

If we're turning in sounds with this, you're gonna have to bring in the media Lee. I'm copying what we have now to disk and leaving.