While one person takes his tree-building turn, the other player(s) expend resources on abilities to slow them down.
have a column of icons for different abilities for each player. keyboard controls their selection, activation, and control.
Example: While player 2 builds, player 1 decides to spawn a fire, which burns up random branches, destroying leaves and preventing growth for a certain number of turns.
Or: While player 3 builds, player 2 takes control of the pigs that spawn !!
Other ideas: root-eating/leaf-eating insects, squirrels that spawn seeds for sneak attacks, disease (contagious!), bomb fruits.
Ideas for levels so far: Normal field level, wherein one must capture pigs that fly by; Cave level, in which spots of sunlight are very important; Post-Apocalyptic city level, with underground and overground obstacles and bomb fruits? mines? lasers? something.
Tuesday, March 11, 2008
New Version of Treemaker
Treemaker version 7.
This is a huge update, though much of it is behind-the-scenes slickness.
New implementations:
1. Instead of click-and-drag, a click-and-click-again method is now used for branch placement. This helped fix a lot of the graphical errors...
2. Fixed rotation arc of roots and leaves. They now have a maximum rotation from the angle of branch placement, meaning awkward-looking leaves and roots are now less likely. Roots also sense when they are close to the surface and rotate down instead of looking at the angle of placement.
3. Extra leaves now appear from a leaf's stem when one clicks on a leaf. They have similar rotational properties as the normally-placed leaves, in fact they are identical, besides having been created by a different function. addRoot(), addLeaf(), and addKnot() are all separate functions, now. Much more streamlined. Too bad I was sloppy and ended up using two functions for the leaves- addLeaf() and addAdditionalLeaf(). But maybe the latter can be turned into addAdditionalLeaves(), and it can produce two leaves at once for the same cost as a branch+leaf. Or something. Trying to think in the context of strategy, here.
4. New branches now have a maximum scale equal to the scale of the knot they are building off of. This means no more huge branches coming off of tiny ones! This is a huge thing, and took much time. My solution involved recording the scale of the knot that is clicked on to begin the startAddBranch() method and then using it as a limiter. The syntax (and finding the event.target.scaleX command) was the difficult thing to figure out... event.target lets you access the clip (/object, perhaps?) that has been clicked on to start the current Listener method.
5. The Treemaker now keeps track of number of players and makes a newTree object that includes (so far) separate arrays for knots, branches, leafs, and Roots, the numbers of each, the branchLength for the tree (they can now be different!), and the player's resources, for each player. The newTrees are created and added to an allTrees array in a function called by the constructor function. Number of players and current player are now kept track of, as well, and all of this new organizational stuff is implemented (the program actually works with all of it, so far). This also took a long time, but it was mostly trying to translate hacked-together code into nice, neat code.
Fixed bugs (and how I fixed them):
1. Full-scale branch flashing for a moment at first click: I added a call for the rotate() method before the addChild for the branch (so the branch is rotated and scaled before it's placed). The rotate() method (along with pretty much everything else) received and overhaul.
2. Extra leaves appearing when trying to click-and-drag a new branch from an overcrowded knot: Making the branch building click-and-click-again fixed this; I actually decided to implement it correctly after it had been removed as a bug (#3).
3. Ground-level bug- sometimes leaves would appear below ground level, or roots above: This was fixed (more or less) by moving the seed slightly below ground level and having roots and leaves sense where they've been placed in relation to the ground level (instead of trying to use the coordinates of the point they've been built off of). Trace commands of groundLevel and the corresponding leaf/root variables were helpful.
4. Ends of new branches slowly cover up knots: I played around with this, ended up moving the registration for the branches up one point on the x axis, but decided that there needed to be some sort of limiter for the number of branches coming off of a single knot.
5. Roots scaling too small: I made them scale up according to a certain formula, instead. They start at half scale and go up from there. Looks pretty decent.
Bugs that Remain:
1. Once in a while, a new branch is placed slightly off of its knot, or a new knot is placed slightly off of its branch. No big deal; I also have no idea why it happens. Might not be happening in latest version.
Treemaker Parts Left to Implement:
1. Try adding new branches onto the ones they grow from with addChild(). Hopefully, this will make removing everything after a break in a branch as simple as removing the segment that broke.
2. Need a method to remove branch segments, for fighting and perhaps for own-tree-tweaking.
3. Add resources, including a method of calculating them (take lower number of sunlight & soil), a way of calculating sunlight and soil (need to figure out hit detection for the sunlight, probably), and something that keeps track of the resources as they are used (and prevents the player from using more than they have).
4. Add growth, after resources are sorted out. Each branch and knot's scale should be incremented by a certain amount for a certain resource cost, once the player's turn is over and remaining resources are calculated.
5. Add wind effect (leaves move in tandem according to some sort of timer-based formula function)- have to send each player's array of leaves through a function that changes their rotation.
Metagame Parts Left to Implement:
1. Title screen, with buttons that allow the user(s) to change the settings- pick number of players and each player's tree type, as well as level select. Need to make art for title screen, buttons, and different trees. Plus the graphics for every level.
2. Figure out the whole "level background" thing. This means turning the parallax scrolling level I made into a nice, neat com package that can be imported by my document class. And designing and drawing new levels. Eventually. This includes adding wind, sun, etc.
3. The actual turn structure! This is big, but probably not that difficult to figure out. Players each have a turn, starting from player one and rotating through until the number of players has been reached. Each player's first turn consists of placing their seed. Subsequent turns allow the player to spend resources on branches (MAKE SURE THERE'S A COUNTER TO KEEP TRACK OF RESOURCES OF EACH PLAYER) or bank them to make their tree's scales larger. Fighting comes into play. When every player's turn is over, the SUN comes by and grants a refill on resources (up to each player's resource cap, determined by number of leaves and roots). This means there needs to be a way to determine how much sunlight each tree gets (sunlight needs to be blockable by branches/knots). This is while the win conditions are not met, of course-- CAPTURE THE FLAG, wherein every tree tries to rack up points by controlling (being the only one with branches in) a certain area, seems like a good idea.
RESOURCE NOTES: Additional leaves should cost less than original ones (maybe?), smaller branches should cost less (maybe?)
4. Results screen, after the game has ended (player reaches goal (or number of capture points) or destroys first branch of all other players). Have some player stats (number of branches, leafs, and roots broken, number built, number of players killed, time in capture area, resources collected, etc.
IDEA: Maybe make this a capture-the-flag sort of game? Or have options for different playing modes- capture the area, deathmatch, grab the pig, or twixt (get across the opponent to the other side).
5. Additional game elements: squirrels/new seed placements, rain?, disease, fire?
This is a huge update, though much of it is behind-the-scenes slickness.
New implementations:
1. Instead of click-and-drag, a click-and-click-again method is now used for branch placement. This helped fix a lot of the graphical errors...
2. Fixed rotation arc of roots and leaves. They now have a maximum rotation from the angle of branch placement, meaning awkward-looking leaves and roots are now less likely. Roots also sense when they are close to the surface and rotate down instead of looking at the angle of placement.
3. Extra leaves now appear from a leaf's stem when one clicks on a leaf. They have similar rotational properties as the normally-placed leaves, in fact they are identical, besides having been created by a different function. addRoot(), addLeaf(), and addKnot() are all separate functions, now. Much more streamlined. Too bad I was sloppy and ended up using two functions for the leaves- addLeaf() and addAdditionalLeaf(). But maybe the latter can be turned into addAdditionalLeaves(), and it can produce two leaves at once for the same cost as a branch+leaf. Or something. Trying to think in the context of strategy, here.
4. New branches now have a maximum scale equal to the scale of the knot they are building off of. This means no more huge branches coming off of tiny ones! This is a huge thing, and took much time. My solution involved recording the scale of the knot that is clicked on to begin the startAddBranch() method and then using it as a limiter. The syntax (and finding the event.target.scaleX command) was the difficult thing to figure out... event.target lets you access the clip (/object, perhaps?) that has been clicked on to start the current Listener method.
5. The Treemaker now keeps track of number of players and makes a newTree object that includes (so far) separate arrays for knots, branches, leafs, and Roots, the numbers of each, the branchLength for the tree (they can now be different!), and the player's resources, for each player. The newTrees are created and added to an allTrees array in a function called by the constructor function. Number of players and current player are now kept track of, as well, and all of this new organizational stuff is implemented (the program actually works with all of it, so far). This also took a long time, but it was mostly trying to translate hacked-together code into nice, neat code.
Fixed bugs (and how I fixed them):
1. Full-scale branch flashing for a moment at first click: I added a call for the rotate() method before the addChild for the branch (so the branch is rotated and scaled before it's placed). The rotate() method (along with pretty much everything else) received and overhaul.
2. Extra leaves appearing when trying to click-and-drag a new branch from an overcrowded knot: Making the branch building click-and-click-again fixed this; I actually decided to implement it correctly after it had been removed as a bug (#3).
3. Ground-level bug- sometimes leaves would appear below ground level, or roots above: This was fixed (more or less) by moving the seed slightly below ground level and having roots and leaves sense where they've been placed in relation to the ground level (instead of trying to use the coordinates of the point they've been built off of). Trace commands of groundLevel and the corresponding leaf/root variables were helpful.
4. Ends of new branches slowly cover up knots: I played around with this, ended up moving the registration for the branches up one point on the x axis, but decided that there needed to be some sort of limiter for the number of branches coming off of a single knot.
5. Roots scaling too small: I made them scale up according to a certain formula, instead. They start at half scale and go up from there. Looks pretty decent.
Bugs that Remain:
1. Once in a while, a new branch is placed slightly off of its knot, or a new knot is placed slightly off of its branch. No big deal; I also have no idea why it happens. Might not be happening in latest version.
Treemaker Parts Left to Implement:
1. Try adding new branches onto the ones they grow from with addChild(). Hopefully, this will make removing everything after a break in a branch as simple as removing the segment that broke.
2. Need a method to remove branch segments, for fighting and perhaps for own-tree-tweaking.
3. Add resources, including a method of calculating them (take lower number of sunlight & soil), a way of calculating sunlight and soil (need to figure out hit detection for the sunlight, probably), and something that keeps track of the resources as they are used (and prevents the player from using more than they have).
4. Add growth, after resources are sorted out. Each branch and knot's scale should be incremented by a certain amount for a certain resource cost, once the player's turn is over and remaining resources are calculated.
5. Add wind effect (leaves move in tandem according to some sort of timer-based formula function)- have to send each player's array of leaves through a function that changes their rotation.
Metagame Parts Left to Implement:
1. Title screen, with buttons that allow the user(s) to change the settings- pick number of players and each player's tree type, as well as level select. Need to make art for title screen, buttons, and different trees. Plus the graphics for every level.
2. Figure out the whole "level background" thing. This means turning the parallax scrolling level I made into a nice, neat com package that can be imported by my document class. And designing and drawing new levels. Eventually. This includes adding wind, sun, etc.
3. The actual turn structure! This is big, but probably not that difficult to figure out. Players each have a turn, starting from player one and rotating through until the number of players has been reached. Each player's first turn consists of placing their seed. Subsequent turns allow the player to spend resources on branches (MAKE SURE THERE'S A COUNTER TO KEEP TRACK OF RESOURCES OF EACH PLAYER) or bank them to make their tree's scales larger. Fighting comes into play. When every player's turn is over, the SUN comes by and grants a refill on resources (up to each player's resource cap, determined by number of leaves and roots). This means there needs to be a way to determine how much sunlight each tree gets (sunlight needs to be blockable by branches/knots). This is while the win conditions are not met, of course-- CAPTURE THE FLAG, wherein every tree tries to rack up points by controlling (being the only one with branches in) a certain area, seems like a good idea.
RESOURCE NOTES: Additional leaves should cost less than original ones (maybe?), smaller branches should cost less (maybe?)
4. Results screen, after the game has ended (player reaches goal (or number of capture points) or destroys first branch of all other players). Have some player stats (number of branches, leafs, and roots broken, number built, number of players killed, time in capture area, resources collected, etc.
IDEA: Maybe make this a capture-the-flag sort of game? Or have options for different playing modes- capture the area, deathmatch, grab the pig, or twixt (get across the opponent to the other side).
5. Additional game elements: squirrels/new seed placements, rain?, disease, fire?
Saturday, March 8, 2008
Flash Game of Note: Caravaneer
Caravaneer: Post-apocalyptic caravan trading simulation with turn based combat. Love the complexity, the stats, the graphics, and the map movement. More here.
Tuesday, March 4, 2008
Bug List 1
Bugs to fix:
1. That full-size branch that automatically flashes in original position right when you click, before you start to move the mouse.
Solutions: Try putting addChild for the new branch after the rotate() call.
2. Extra leaves/roots appear when clicking on (trying to build from) an overfull knot.
Solutions: ?? Maybe some of the other fixes will fix this too?
3. Ground-level bug- sometimes roots appear above ground/leaves appear below.
Solutions: Try putting a trace on the "prev" variables, the groundLevel... be able to tell before placement whether something will be a leaf, knot, or root.
Note: might not need to worry about this (try adding the background first!).
4. The ends of new branches slowly cover their origin knots.
Solutions: Make X registration for the branches start at 0.
Note: might not be a bug, but a happy-accident (it's a useful limiter vs. overgrown knots).
5. Roots get too small-looking, but I like the varied sizes that scaling brings.
Solutions: Don't scale down for smaller roots- scale up for larger roots!
1. That full-size branch that automatically flashes in original position right when you click, before you start to move the mouse.
Solutions: Try putting addChild for the new branch after the rotate() call.
2. Extra leaves/roots appear when clicking on (trying to build from) an overfull knot.
Solutions: ?? Maybe some of the other fixes will fix this too?
3. Ground-level bug- sometimes roots appear above ground/leaves appear below.
Solutions: Try putting a trace on the "prev" variables, the groundLevel... be able to tell before placement whether something will be a leaf, knot, or root.
Note: might not need to worry about this (try adding the background first!).
4. The ends of new branches slowly cover their origin knots.
Solutions: Make X registration for the branches start at 0.
Note: might not be a bug, but a happy-accident (it's a useful limiter vs. overgrown knots).
5. Roots get too small-looking, but I like the varied sizes that scaling brings.
Solutions: Don't scale down for smaller roots- scale up for larger roots!
The Treemaker Cometh
http://www.uwm.edu/~rakunz/files/treemaker4.swf
Here's the treemaker, so far as it is. It makes a pretty decent facsimile of a tree, if I do say so myself. First click places the seed, additional click-and-drags create branches. If a branch is dragged under it's max length, the branch scales. If it's still over half of its max length, the knot that is created scales. If it's under half of its max length, it makes either a leaf or a root, depending upon whether it's above or below ground level (theoretically-that last part still has kinks in it).
I'm stoked!
My friend Tom helped me out with the scaling-of-the-branch; specifically the equations that would give the coordinates of the new knot-to-be-created. I figured out the branch rotation with the help of a neat tutorial (unfortunately in AS 2.0; had to translate it), and did the rest myself. With my mind.
Here's the treemaker, so far as it is. It makes a pretty decent facsimile of a tree, if I do say so myself. First click places the seed, additional click-and-drags create branches. If a branch is dragged under it's max length, the branch scales. If it's still over half of its max length, the knot that is created scales. If it's under half of its max length, it makes either a leaf or a root, depending upon whether it's above or below ground level (theoretically-that last part still has kinks in it).
I'm stoked!
My friend Tom helped me out with the scaling-of-the-branch; specifically the equations that would give the coordinates of the new knot-to-be-created. I figured out the branch rotation with the help of a neat tutorial (unfortunately in AS 2.0; had to translate it), and did the rest myself. With my mind.
Subscribe to:
Posts (Atom)