TCD - Tablet Castle Defense
Let's make a prototype
Definitions:
- Main Wall - A wall that contains your Lord. Concentric rings count. Small towers not connected to any walls that contain your Lord do not count.
- Ancillary Wall - A wall that does not contain your Lord. Any non-Main Wall. Enemies generally will ignore these except for pathfinding purposes.
Large scale tunable parameters:
- Map size (tilesXtiles)
- Quantity of Rocks on map
- Quantity of Trees on map
- Stone resource gained from harvesting a Rock
- Wood resource gained from harvesting a Tree
- Time to harvest a Tree. Time to harvest a Rock.
- Cost for a wall in Rock.
- Cost for manpower on top of wall in Tree.
- Starting Stone resources
- Starting Wood resources
How to play:
- Draw walls with stylus when applied to areas not enclosed by castle or covered with wall. Walls are placed in 1x1 tiles at a time. You cannot place a wall atop an enemy.
- Draw units with stylus when applied to areas of wall without units.
- (future) Upgrade a unit when tapped on
- (future) Activate a building
- Tap on a ladder with no enemies on it to destroy it
- Tap on any enemy to make units in range attack it instead of anything else in their range (after killing it, they will go back to whatever they would normally attack) This clicked on enemy needs a target reticle on it to show it is your current target. You can only have one target at a time.
- Tap a Rock or Tree to start harvesting resources from it.
- Each time an enemy reaches your Lord, it does one damage to your Lord and then dies. 10 damage and your Lord is dead. You lose. Your Lord begins on a 3x3 section of wall with four 1x1 wall stubs jutting out from it (with stonethrowers)
Automated stuff player doesn't need to think about:
- Defensive units that have targets within range will attack those targets, preferring targets that are closer to targets.
Enemies:
- Fodder - These guys run up to a main wall looking for a way in. They will randomly either walk to the left or right when they hit a wall until they find a way to your Lord. They will use ladders or holes in the wall if they come to one.
Ladder guys - These guys go towards the nearest main wall section without a ladder on it. When they get there, they spend (time to finish ability) time putting up a ladder. Once the ladder is up, they climb the ladder at LadderspeedMultiplier*MovementSpeed. Consider the ladder one tile space for this purpose. Ladder guys have a special tunable variable: LadderSpeedMultiplier
- Sappers - These guys go towards the nearest main wall section without a ladder on it. When they get there, they spend (time to finish ability) time detonating the wall. When the wall is detonated, they die. The wall is now gone but can be built again.
- Once any unit reaches the top of your wall, he will attack any units between him and the Lord. He will otherwise attempt to get to the Lord.
- Tunable enemy parameters
- size, movement speed, HP, armor, time to finish ability, rate of fire, damage, desirability as target
Defenses:
- Stonethrowers - These guys are what you get when you click on a wall space that can only fit a 1x1 character. They cannot fire over another wall.
- Archers - These guys are what you get when you click on a wall space that can only fit a 2x1 character. They cannot fire over another wall.
- Tunable defender parameters
- size, HP, armor, rate of fire, damage, desirability as target, weapon range
Graphics:
- Super simple atari 2600 style.
- light green for field, gray for rocks to harvest, dark green for trees.
- white for castle walls
- tan ladder symbol for ladders on walls
- Characters:
- Black stonethrowers
- Dk Green archers
- Tan ladder guys
- Red sapper guys
- Gray fodder guys
- Indigo Lord
- Projectiles just black and brown 4x4 rounded dots for now.
- Red block explosion when sapper completes sapping of a wall?
- Hud Elements
- Quantity of Rock / Wood
- Minimap with dots corresponding to above colors. 1px = 1 tile (40x40)
- List of things that can be built and cost and symbol
- Walls, stonethrowers, archers
Ideas for expansion
== Attackers: ==
- Ladder guys - These guys bring ladders to your walls. When a ladder is empty of enemies, you can click it to destroy it.
- Tower guys - These are tougher than ladder guys because they have shelter. You need catapults to destroy these.
- Battering ram guys
- Catapult guys
- Sappers
== Defenses: ==
- 1x1 wall (blank on either side) = Stone throwers
- 2x1 wall (blank on either side) = Archer wall
- 3x3 wall (blank on either side) = Ballista wall
- 2x2 empty space surrounded by wall = Barracks (generates guards)
- 3x3 empty space surrounded by wall = Armory (stronger weaponry)
- 4x4 empty space surrounded by wall = Stable (send out guards as cavalry)
- 5x5 empty space surrounded by wall = Farm (extra health)
- 4x4 wall = Catapult
- Gates
- 2x2 wall surrounded by space = Boiling Oil
== Resources: ==
- Stone tiles
- Trees
== Specs: ==
- Screen Resolution: We should be aiming to work with resolutions from 640x480 up to 1280x1024/1366x768. This may mean two resolutions of art. 40x40 tiles/map.
Discussion
Paw notes that we are #4 on google's search for "Tablet Games".
Paw purrs, "So I was thinking... we should make some simple games that make good use of tablet tech and put them up on STG for sale."
Paw purrs, "Like some puzzle games."
Paw purrs, "We could even get some extra mileage out of our tech..."
Paw purrs, "The CQ tool is essentially a tile drawing tool."
Paw purrs, "So maybe we could make a castle defense game where you draw the walls, and do gestures for fixtures, like drawing a quick circle will build a tower with a catapult, and drawing a quick square makes a ballista."
says Cal, "Biggest problem I'm having is getting libraries built for strict license compliance."
Paw purrs, "What about for XP as opposed to PPC? Tablet PCs are XP or Vista."
says Cal, "desktop I should be good."
Paw purrs, "Might want to also compile it for PPC so you can test the drawing feel."
Paw shrugs.
Akili has reconnected.
says Cal, "I'll need to go through and make sure we have source-binary matches for a couple libraries."
Paw purrs, "So here's how I figure we get some extra mileage from the tech."
Cal waves.
Paw purrs, "Howdy."
Akili rumbles lightly, "G'morning."
Paw purrs, "The castle wall drawing game will have to have algorithmic tile placement... so when you place a wall section, you check the adjacent 8 cells to see if you need to modify them, then place the tile based on what surrounding 8 tiles are filled."
Paw purrs, "And maybe different wall configurations would automatically generate certain kinds of defenses."
Paw purrs, "You get a 2x4 section of wall, and it fills with archers."
The hushed stillness falls across the hot training ground.
Paw purrs, "You build a 3x3 section of wall and you get some stone throwers."
Paw purrs, "Or something."
Paw purrs, "Anyway, we could reuse the tech for CQ's editor to make it easier to draw maps."
says Cal, "similar to tower defense, but different."
Paw nods, "Yeah, a rather unique style of Tower Defense."
Paw purrs, "You'd probably have the enemies trying to breach your walls."
Paw purrs, "So different kinds of enemies could include guys with ladders, catapults, sappers, battering rams, etc."
says Cal, "you place the walls and ramparts, troops fill in."
Paw purrs, "Right."
Paw purrs, "You'd probably want ... like a minimap at the bottom. So you can quickly look around the battlefield to see what's coming."
Paw purrs, "And as you get farther in the game, your castle may not fit on the screen without scrolling."
Cal muses, "a sloping earth face repels siege towers and sappers, but makes it easier for other enemy troops to climb the face of the wall."
Paw purrs, "We already have a bunch of art we can use from CQ for the walls and stuff. I'll probably have to make some modifications."
says Cal, "catapult emplacement behind the wall can attack distant forces, but doesn't do so well against moving targets or anything too close."
Paw purrs, "Which you'd want the boiling oil for stuff near your wall."
Paw purrs, "Cool. I'm stoked."
Paw asks, "Think we could pull this off in maybe a couple of months?"
says Cal, "Of course the castle must have a front gate, from which calvary charges can emerge."
Paw purrs, "Right."
says Cal, "for desktop primary? I think I can have this and dPlenty in that time frame."
Paw purrs, "Hadn't thought of that. And wherever a gate is, that's where the battering ram folks go."
says Cal, "Gate can have defenses behind, like holes to pour hot oil, arrow slots, a second gate."
Paw asks, "Awesome. I'll see about getting you some art to use. For now... we can use the town tiles map for CQ. See if you can get a nice random foresty area generator done?"
Cal will need a design doc.
Paw nods, "Alrighty. I will get cracking on that."
says Cal, "Based on your neat tree tiles? can do."
Paw purrs, "So I think part of the game will be using up stuff on the map. Like trees and rocky bits."
Paw purrs, "Tapping those areas to 'mine' them."
says Cal, "hm, forest hit by catapult takes damage. hit by lighter weapons trees survive."
Paw purrs, "Getting you resources to build your castle."
Paw purrs, "Heh, cool."
says Cal, "elements from warcraft 1,2 or the like."
Paw purrs, "Well, we would want to keep it as simple as possible."
Paw purrs, "So no sending out dudes to mine it. You just tap on it."
says Cal, "but light forges can move through forest, remaining partly hidden."
Paw purrs, "And you get a little marker on it showing that you're mining it. Then eventually the tiles would vanish when you're done mining."
- s/forges/forces/
Paw purrs, "Totally. So you want to clear out forest next to your castle. Otherwise your archers have a harder time hitting incoming enemies"
says Cal, "but the enemy might capture/destroy your harvesting operation."
says Cal, "So, no workers running around, no training of forces, but your forces need an emplacement to fight from."
Paw purrs, "Right. You build an emplacement, and it automatically spawns forces for you."
Cal puzzles, "figured how we're going to be selling software?"
Paw purrs, "Suitable for the emplacement."
The warm calm settles over the grass.
Paw purrs, "We can do mailed CDs or downloads. I like downloads."
Paw purrs, "I don't really want to focus too much on stopping piracy. Just put up rudimentary defenses so they can't just download the game and start playing super easily."
says Cal, "with CDs we'd handle license requirements by putting library source on the CD. for downloads making the library source a separate download is likely prefered."
Paw asks, "Maybe a license key based on an email address?"
Paw purrs, "We send the key to the email address."
says Cal, "Show me a practical anti-piracy measure that isn't a pain and I'll use it."
Cal puzzles, "license keys such that any valid key works for any copy?"
Paw purrs, "What about the key/email address thing? I'd call that a simple non-annnoying method."
Paw purrs, "Yeah."
says Cal, "Enter the key once on first run and it saves the key."
Paw purrs, "Because if we key it to the copy, there's nothing to keep them from redistributing the key + install."
says Cal, "should it get a bad key it asks again."
Paw purrs, "So no reason to have different installs for each key."
Paw purrs, "Right. And probably provides a link to purchase a key"
says Cal, "so I need to work out a system where we can easily generate keys, but random keys won't work."
Paw purrs, "Heck, we could just put the install up on the site as demoware. Unlock the full game with a key."
Paw purrs, "One hour of play free, after that, purchase the game."
says Cal, "limited version playable without key."
Paw purrs, "Right... well the key would be tied to the email. You have to enter the email + key."
says Cal, "Ah, key generated from the email, as a hash function."
Paw purrs, "so the key is really some sort of encrypted form of the email. And if they don't match, then ... yeah."
Paw purrs, "Probably should make sure it is NOT case-sensitive. Just in case."
says Cal, "right, easy enough."
Paw purrs, "Makes it slightly less secure, but close enough."
says Cal, "what if a customer mis-enters their email when buying? wrong key sent to wrong address."
Paw purrs, "..."
Paw purrs, "PEBKAC"
says Cal, "This computer stuff would be much easier if we could ignore users."
Paw asks, "Well... jeez. What if they give us the wrong shipping address?"
Paw asks, "When ordering Dungeon Escape!, am I supposed to send out another copy?"
Paw purrumbles, "Customer Service says yes. Annoyed Salesperson says gah!"
says Cal, "Right. need to make very clear that we need a valid email."
says Cal, "I've seen a lot of sites that make you enter your email twice."
says Cal, "probably want to include the product code in making the key, so the same key doesn't work for out entire software line."
The warm stillness falls on the plants.
Paw purrs, "Right. Or use a different hash for each software. But yeah, having a special added code for each product would help."
Paw purrs, "We could even assume that the base password is always 64 characters long, then have a 64 character code that their email is superimposed onto before generating the code."
says Cal, "truncating the email if too long."
Paw purrs, "Maybe do 32 characters, where the first 24 could be overlaid with their email... Don't want them to do a 32 character email that works for every product. =D"
Paw purrs, "Right, truncate."
Cal considers using the standard crypt function.
Cal goes Away From Keyboard. (AFK)
Paw purrs, "Yeah, in less than 2 days, we got 6 google hits from 'Tablet Games'"
Paw purrs, "We really need to get a few cheap games designed for tablet pcs up there."
Design Bash Round 2
Paw ponders, "What do you need for the GDD for Tablet Castle Defense, I wonder." says Cal, "types of units, how they act, how big they are..." Cal puzzles, "Akili, you said signet ringS, how many?" Akili rumbles lightly, "Two. One for each of 'em." Paw purrs, "I assume on the attacker and defender side." says Cal, "yeah, both sides." Paw hms, "Do attackers use the resources on the map as well?" Paw asks, "Like cutting down trees to make battering rams?" Paw ponders. says Cal, "pretty much any info needed to manually play the game." Paw purrs, "And pathing is a question." Paw purrs, "What path do enemies take to your castle... and once there, what do they do." A steady stillness falls over the plants. says Cal, "I have an idea on pathing, given some guidelines on how desirable each player unit is a target for an enemy unit." says Cal, "something not quite as brain dead as I commonly see, but still not a high order strategic pattern." Paw purrs, "Well it should be pretty simple, enough that the players understand what's going on." Paw purrs, "And enough that it doesn't bog system resources." Cal thinks he'd pass on applying the flocking attack pattern he's thought of, as a bit too rough on the player. Shelly has disconnected. Paw purrs, "So I think our map should only contain rocks, trees, grass, and dirt terrain." Paw purrs, "That way the AI doesn't have to try too hard to pathfind to the castle itself." says Cal, "and walls. walls perhaps differentiated by the units that inhabit them for targeting." Paw purrs, "Well, yeah. But it shouldn't need to pathfind around walls... oh." Paw purrs, "I guess it does." says Cal, "The pathfinding I have in mind would a a fair bit of overhead for one enemy, but the overhead applies once for the whole enemy army." Paw purrs, "So. Inside your castle is a Lord." Paw purrs, "And the enemy wants to kill him." Paw purrs, "And you want him to live. Because he's probably you." says Cal, "the lord is a high value target, but lesser targets closer to the enemy may attract more attention." Paw purrs, "Well, the other targets may be considered obstacles." Paw purrs, "A gate is an obstacle for most enemies." Cal puzzles, "Enemy attacking walls/units on walls?" Paw purrs, "Ladder enemies probably consider your archers and other units on the walls obstacles." says Cal, "taking out your forward guard makes it easier for the enemy to get to the lord." Paw purrs, "Right." says Cal, "how resources are harvested needs to be figured. and building costs." Paw purrs, "So for a prototype, let's do simple. Stonethrowers that can be upgraded to archers. And enemies that are ladder guys or sappers." Paw purrs, "Player can click on trees or rocks to start harvesting materials from that resource." Cal puzzles, "sappers destroy wall from below, ladder guys capture wall?" Paw purrs, "Rocks are used to build walls. Trees are used to make dudes." Paw purrs, "Right." says Cal, "captured wall can be recaptured. destroyed wall can be rebuilt." Paw purrs, "Right." Paw purrs, "Captured wall isn't so bad, add a dude back. Destroyed wall costs you a dude AND a wall." Cal puzzles, "units spawn automatically of there's wall space and available resources?" Paw purrs, "Values will need tunability." The still breath of air silently moves across the plants. Paw starts roughing out a doc for specifics. says Cal, "need to load units parameters from a file, fitting a generic template." Cal compares to warcraft1-2, "outside of magic, everything about a character type can be speced in a dozen or so numbers." Cal brainstorms unit stats, "size, movement speed, HP, armor, rate of fire, damage, desirability as target..." Paw updates https://www.splitreflection.com/moinmoin/moin.cgi/TabletCastleDefense A quiet breath of air slowly moves over the plants. Paw purrs, "Still working on stuff, but there's a starting point." Paw purrs, "I'm working on enemy units right now... your stuff there is good... I'll integrate that in a sec." Cal has a slight modification to 'enemy units on map longer', "enemy units closer to targets, measured by the same path system they follow." Paw purrs, "An enemy that has been on the map longer is generally more of a threat." Paw purrs, "And if the player disagrees, he can refocus by clicking." says Cal, "what I'm thinking will largely target the same, as units get closer as they're on the board longer." Paw nods, "Cool." Paw purrs, "We'll do that, then." says Cal, "The pathing I have in mind starts with each square with a unit assigned a number based on how desirable a target it is. each adjacent square is 1 less desirable than the best of its neighbors. thus pathing and target priority in 1 matrix." says Cal, "enemy units on the highest scoring square get priority for being hit." says Cal, "one place this will differ from 'target longest on board' is when you have an outwork thrusting from your main fortress. then enemies targeting the outwork will get attention despite not being on the board as long." The steady calm settles on the plants. Paw purrs, "Done." Paw reads through it to make sure it says what he meant. says Cal, "requires a means to determine if a wall block is main or not. if there's a path to your lord without taking out a wall there is no 'main wall'." Calin says, "Hmm. That's true." Paw purrs, "Main Wall is the wall your Lord sits on, then." Paw purrs, "The Lord isn't in a courtyard. He starts on a 3x3 block of wall." Calin says, "That works. The Lord sits on a rampart surveying the field." Paw purrs, "Any wall that surrounds it or connects to it is a Main Wall." Paw purrs, "And by surround, I mean fully encompasses." Calin says, "So the best strategy is to connect very little to it, but to make concentric rings." Paw purrs, "Possibly." Calin says, "That way enemies scaling the wall will not gain easy access." says Cal, "with the pathfinding I have in mind, 'random' comes into play only when there's 2 or more neighbors to a square equally good to move into." Calin says, "Yeah, I was noticing that too." Paw adds a note to both the Stonethrowers and Archers: They cannot fire over another wall. Calin says, "It will probably not be random which direction units turn when they hit a wall." Calin says, "For that matter..." Calin says, "If the lord starts with a desirability that's really high (like 255), we could have walls decrease it significantly. So if there's a way around the wall, pathfinding will properly route around it." Calin says, "And if there's no route around the wall, fodder will probably collect at the point along the wall that is closes to the lord." says Cal, "those rules have the enemy ignore outworks. so placing isolated outworks well in front would be useful to an extent." Paw purrs, "Yuck." Calin says, "Provided there are no other targets they CAN reach." Paw purrs, "I'd rather they continued following around the wall until someone breaches or puts up a ladder." says Cal, "a square occupied by another friendly unit is, of course, undesirable for moving into. So that might cause some circulation." Calin says, "You could have a wall in the process of being bombed or laddered act like a partial gate for pathfinding, so fodder would approach it as it gets built." Paw purrs, "I have no problem with units stacking. Unless that messes up our renderer." says Cal, "right, compromised wall segments should be higher priority than adjacent segments." Paw purrs, "That would be nice, Calin." Calin says, "With that, they would really only collect in one place if there was no pending opening." says Cal, "I was thinking of collision checking." Calin says, "Which would probably be fine." Paw purrs, "Collision checking for what purpose/" Paw purrs, "Enemy units should not collide with one another." Calin says, "I don't really see collision as necessary, except walls and shots." Paw purrs, "Neither should shots collide with shots." Calin says, "Which is really more like just checking tile location rather than collision." says Cal, "compromised wall with higher priority square behind has higher priority than an uncompromised wall." A soft breath of air moves slowly across the plants. Paw purrs, "So for pathing..." Calin says, "Well, you said earlier than for pathfinding, each square would be marked with a desirability value." Calin says, "Which would spread out in decreasing value." Paw purrs, "You are thinking each square will have a value, with the Lord being 0." Calin says, "Well, when it hits an uncompromised wall, cut the value in half." Paw purrs, "And the squares that are one step away from the Lord being 1." Calin says, "And for a wall in the process of being compromised, cut it by 25%." says Cal, "wall collision is easy, moving unit vs. wall. projectile collision, however, could massively bog down is checked against the list of enemies." Paw purrs, "Projectiles go towards the target and never miss." says Cal, "Same for selecting which enemy to target." Calin nods. "Picked targets before firing." Paw purrs, "That's why I wanted to do oldest targets first. That way you just march up the list." Paw purrs, "Start with the oldest target. Is he in range? No? Try the next one." Paw purrs, "And so on." Calin says, "I'm with Cal against the 'oldest' thing." Calin says, "Though range may help." says Cal, "without some shortcut, target selection easily becomes O(m*n), m being your units, n enemy units." Paw purrs, "Then we sort the list by what tile they are on." Paw purrs, "I don't see a good way around that." Calin says, "going just by age would cause trouble if at some point you wanted to have the enemy build catapults and stuff that don't move." Paw purrs, "Fortunately it only occurs at rate of fire." Calin says, "Or that do move, but don't rush forward." Paw purrs, "Rather than every frame." says Cal, "if enemy units are limited to 1/square, there's a shortcut available for targeting." Paw purrs, "Unless I have no target. Which means it will have to be amortized." Paw asks, "But then we have enemy to enemy collision?" Calin says, "You mean we'll have to adjust the monetary value over a period of time? You've used that word before, and I don't think that's exactly proper use." Paw purrs, "Which I don't want to deal with." Paw purrs, "Means that the processing has to be distributed over multiple frames." says Cal, "enemy-enemy collision is trivial if there's 1/tile." Paw purrs, "So instead of checking every frame for every defender that doesn't have something it is currently firing at, we check X of them per frame." Calin nods. "In the gate maze, I have an array the size of the map. And I store details about each tile in it." Calin says, "So it's VERY fast to check a tile's contents before you walk into it." Paw purrs, "Nice." says Cal, "exactly." Calin says, "It gets less ideal if you have to check a large number of tiles at any given time, but just for moving it's great." Paw purrs, "Hm. So whenever a tile changes from wall to no wall, or no wall to wall, you only adjust the values of tiles either upstream from it." Paw purrs, "So... changing a tile next to the Lord has the highest processor time." says Cal, "the enemy movement algorithm I have in mind involves checking neighboring squares for best score, then moving." Calin nods. Calin says, "Ideally, we wouldn't need to measure our cpu time like that." says Cal, "could have changes take time to propagate." Calin says, "If it takes too long to rearrange the path map in one go, we should find a better way to do it." Paw purrs, "True." Paw purrs, "Spread over frames." Calin reiterates, "We should not have to spread anything over frames.'" Paw purrs, "Which is fine. Just means the AIs don't instantaneously know the perfect path." says Cal, "have a list of squares to update, process out one step/frame." Calin says, "We can if we have to." Calin says, "I suspect we will not thought." Calin says, "Though." Paw purrs, "Ah. I thought that was in reference to the tile next to the Lord taking longest. Not the /frame calculation." says Cal, "I'll want to test on the sluggard computer in the front room here." Paw does some math to determine map sizes. Paw purrs, "40x40 tiles." Calin says, "So an array of 1600. Not too bad." Calin says, "Particularly since we should not need to update every tile when changes are made." Paw purrs, "Gives you plenty of room for castle + surrounding environs." Paw purrs, "And means no matter what your resolution, there will be scrolling." says Cal, "hm, that could be hundreds of enemies. which would massively bog down if not done right." Paw purrs, "Assuming current Tablet PC resolutions." Calin smiles. "So we'll just have to do it right." The placid breath of air quietly moves over the cool bushes. says Cal, "and scanning a list of hundreds of enemies is not, in my opinion, the right way to handle that many." Paw asks, "Divide the map into quadrants?" Paw purrs, "And then you know you only have to check enemies in the quadrants you have range into." says Cal, "helps some, but adds complications moving between sectors." Paw nods. Cal puzzles, "on a 40x40 map, what's the range of an archer?" Paw asks, "Maybe 5 squares?" Paw adds 'Weapon Range' as a parameter. "Are we assuming non-moving friendly troops, and moving enemies?" asks Calin. Cal calculates, then frowns, "120 squares to check if checking for targets by tiles." Paw purrs, "If each sector is 8x8, that would mean you'd never have to check more than 4 squares' worth." Calin says, "That would make it easy." Paw purrs, "We are, Calin." Calin says, "Cool." Calin says, "Then here's what you do." Calin says, "When a friendly is placed, set an 'in range' flag on each tile it can see." says Cal, "if each sector is just large enough, an archer would need check the lists of 4 sectors." Calin says, "When an enemy moves, it checks the flag of the tile it is entering." Paw purrs, "Then when an NPC moves into a tile set 'in range'..." Paw purrs, "Cool." Calin says, "We have to iterate over moving guys anyway." Paw asks, "So you need an 'in range' tag for each friendly per tile?" Calin says, "So each tile I guess can have a list of guys it's in range of, and a distance to that guy." says Cal, "that would put a list of friendlies on each square." Paw purrs, "And then you notify those friendlies and see if they care." Calin says, "When an enemy moves into a square, it goes down the list checking each guy he's in range of." Calin says, "If he is closer than their current target, he becomes the target." says Cal, "Lots of data, not so bad on CPU." Calin says, "This isn't a pocketPC, so a bit more data should be ok." Paw purrs, "Nice... so the Archers can't shoot over walls. So when you set him down, you do a line of sight 'render' to the tiles." Calin says, "Sure. And you'll need to update it when walls are built." Calin says, "In the same pass as updating the pathfinding." Calin says, "And with almost exactly the same code." says Cal, "ah right, that line of sight could be quite a bit of overhead depending on method." Paw purrs, "And if a tile changes that has line of sight set adjacent to it, you fix those friendlies' line of sights." Paw purrs, "Sounds like 2 months just for the prototype." Calin nods. "I find it useful to first consider which iterations you cannot do without." Calin says, "And anybody that moves must be iterated over." Paw purrs, "Say nothing of the expansion bits like catapults and other enemy ai." Calin says, "So then we try to do any tasks that relate to them during that iteration." says Cal, "to limit data usage, limit the list to the N 'closest' friendlies. rock throwers counting as 'closer'." Calin says, "Like them being targeted by defenders." Calin says, "Sure." Calin says, "That limit would be on the list in the tile though." says Cal, "right." Calin says, "When a guy is placed and his 'in range' tiles are marked, he is left off the list if the tile already has closer guys targeting it." Calin says, "Just give a 'max targeters' value or something. If we already have 4 guys targeting this square, you don't get on the list unless you're closer." says Cal, "That would tend to limit everyone targeting the same enemy with a massive overkill." Calin says, "If that's a compile-time parameter, we can just tweak it until we get the right balance." says Cal, "would also limit practical unit density." Calin says, "I would prefer we didn't have that limit." Calin says, "But we can have it if we need it." says Cal, "for development I could have a high compiled in limit and a configurable limit under that." A quiet fog settles silently on the arched gateway. says Cal, "well, given a path between to parallel ways, archer range 5, I figure a max of 22 archers in range of a square." says Cal, "some configurations may have a few more." Calin says, "We could also save ram by using linked lists." Calin says, "Though that adds some management overhead." says Cal, "If we limit friendly units to 255 total, that's 1 byte/unit on the list. so, 32units / square x 40 x 40 = 51200 bytes." says Cal, "linked lists have massive overhead when the data being carried is so small." Calin says, "A description of all the data we're going to store per square would be good." Akili waves, and goes to bed. "Targeting data, obstacles, pathfinding... more?" asks Calin. says Cal, "goodnight." Calin waves. "Good night." Akili has dropped a connection. says Cal, "obsticles and pathfinding are a few bytes each." Paw purrs, "Well, I'm done adding to the wiki for now if you want to add more technical data." Paw updates Chaosmage.com says Cal, "each unit a dozen bytes or so. So far the proposed targeting lists by far dominate memory usage in game data, but are less that I expect for game images." Calin says, "I should go to bed too. This game sounds like a lot of fun."