|
IfThenSoftware
|
 |
« Reply #15 on: June 20, 2010, 05:45:25 PM » |
|
NewsNew concept art for Merki has been released, along with a look at the artwork pipeline.   From the ProgrammerWritten by InvisibleLast week I created a model viewer for our artist, GreyKnight. I was unable to find a 3D modeling program which allowed enough fine-tuning of the camera and projection. The artwork needs to be drawn at an orthographic custom-isometric angle so that the texture looks correct after being applied to a mesh. The closest I was able to get was Wings3D, but it wasn't quite close enough. While powerful, their custom camera coordinate editor wasn't designed with this kind of thing in mind. I finally settled on setting up a special copy of the isometric workbench which loads a model called test.ms3d and displays it. It would have been nice to keep model editing and capturing in the same tool, but this works fine. It turns out that it was a good thing I created that model viewer. One of the requirements for it was a lighting system. The reason for this is to make it easier for GreyKnight to find the edges between polygons; with flat shading, the only way you will see them is if you color them separately in the model editor. I already had a usable lighting system jury-rigged to the vertex projection system (the testbed uses software transformation currently), but the lighting would change as you moved the camera around, and it wasn't at quite the right angle. So I created a basic light which could be moved around until we found the correct angle. Unfortunately, as I moved the light around I noticed it was flashing in and out at certain positions. After double-checking the code, I found what appeared to be the problem: the dot product was taking into account the w component of the vectors. Thinking it must have been a copy+paste error, I removed the code and tried the demo again... To find that everything had disappeared. You may have already guessed it; that w in the dot product calculation was being used in projection. To make matrix-vector multiplication code easier to read, I was creating temporary vectors from the matrix and performing a dot product between them and the vector. Unfortunately, the w component is infact required for this to work correctly. After I found what the root problem was, the solution was rather direct: create separate 3x3 and 4x4 matrix classes, as well as 3D and 4D vectors. The math system is once again working correctly, as far as I can tell. I was two days into the design of the rendering pipeline when I stumbled on an interesting technique: instancing. Instancing, in reference to rendering, is where you have one copy of a mesh's geometry which is drawn over and over again for each instance of its use. For example, you would send the geometry for a tree to the graphics card, and then just send a bunch of draw operations with different world matrices to position the tree in the correct location and orientation. Without instancing, you would need to send the geometry for that tree in addition to each world transform to the graphics card with each draw operation. I started work on a new design, but the events I mentioned previously held me up for most of the week. I plan on finishing the design next week, and hopefully I will be posting a video showing off the new renderer. Artist's EaselWritten by GreyKnightiScribble Sketches #26(Click to enlarge)
(Click to enlarge)
Community SpotlightWritten by jaythemageOver the past week, a challenge was issued to the SAO community: If we donate a total of $500 to IfThen Software, the development team will update SAO. There has been much debate over what would happen should this actually occur, but the general consensus is that if anyone has a few extra dollars, he/she would donate a little. Maybe over time, the $500 mark will be reached. To contribute to future community spotlight articles, please visit this forum: http://www.ifthensoftware.net/forums/index.php?showforum=37Funny Quote of the WeekFrom the IRC chatroomBackground information: Pifreak (an SAO moderator) was talking with the people in SAO, and tried giving a link to the forums using a non-existent HAL command. HAL shows the SAO in-game chat in real-time. pifreak: .say forums pifreak: HAL: Syncopation: http://www.ifthensoftware.net/forums/InvisibleMan: Wow, it worked
|
|
|
|
|
Logged
|
|
|
|
|
IfThenSoftware
|
 |
« Reply #16 on: November 11, 2010, 06:42:56 PM » |
|
NewsDevelopment on Stick Adventures Online will be starting very soon. Check the game's website to see our progress till then. From the ProgrammerWritten by InvisibleI've spent the last 4-5 months studying physics. I'll need that knowledge for Merki, the SAO updates, and probably every other project we work on. For anyone interested, these are some good resources for learning physics: http://www.brightstorm.com/math - Introduction to calculus http://ocw.mit.edu/courses/mathematics/ - Calculus, differential equations http://www.physicsclassroom.com/Class/ - Beginner level physics http://electron9.phys.utk.edu/phys135d/Modules.asp - College level physics. There are some typos though, so watch out for that. http://chrishecker.com/Rigid_Body_Dynamics - Rigid body dynamics, specific to game programming. http://gafferongames.com/game-physics/ - Solid groundwork for making a physics simulation. http://www.cs.cmu.edu/~baraff/sigcourse/ - Particle systems and rigid body dynamics, specific to game programming. So far, I have a working particle system and unconstrained rigid bodies. If you are interested in seeing the physics system in its current state, you can get it here. Artist's EaselWritten by GreyKnightiScribble Sketches #27(Click to enlarge)
Community SpotlightWritten by jaythemageIn August, after Corvus stated that mods were dead because of the strict rules of using copyrighted material, Ace created and released a "Mod Scene Defibrillator" called SAO_DAT_EDIT. This program allows users to edit the DAT files of SAO to change image proportions which enables modders to edit the sizes of the sprites and have an even broader variety of ideas for mods. However, the program has not been used to create any mods by this time despite the major potential of the program. The wait has been long, but fans of Stick Adventures Online are finally getting another major update. There have been several predictions of what exactly will be included in the update; however, the most common are that there will be at least one new map and that there will be several new enemies. Though there will be a price to pay for the update, many fans are willing to pay to play SAO's big update, even though they do not yet know how much it will cost. Funny Quote of the WeekFrom the SAO moderator's channelBackground information: An SAO player had just been banned for swearing. pifreak (an SAO moderator) then said this in the moderating channel, regarding the recent ban. pifreak: *tutorial* How not to respond to the queston: "Why did you avoid the filter?" pifreak: "i dont know i'm kinda bored lol"
|
|
|
|
|
Logged
|
|
|
|
|
nikki
|
 |
« Reply #17 on: November 18, 2010, 02:41:43 PM » |
|
Fantastic posts !
great
i love those sketches too
|
|
|
|
|
Logged
|
|
|
|
|
IfThenSoftware
|
 |
« Reply #18 on: November 18, 2010, 06:37:21 PM » |
|
NewsThere is no news to report in this issue. From the ProgrammerWritten by InvisibleIt turns out that my previous trouble with non-penetrating rigid body simulation was actually caused by an incorrectly calculated collision normal. On vertex-vertex collisions, the normal was chosen to be pointing in the direction of the center of the body to the point of collision. Handling vertex-vertex collisions as vertex-edge collisions solved the problem and the simulation no longer stalls as frequently when two bodies collide. You might have noticed I said "as frequently". That is the problem I have been trying to tackle since Monday. The simulation will sometimes stall when two bodies collide, and it will definitely stall if I try to stack two or more bodies on top of each other (or push them into a wall, etc). I suspect this is at least partially because I am not applying resting contact forces. I read through the "Resting Contact" section of David Baraff's " Rigid Body Simulation II - Nonpenetration Constaints" from " Physically Based Modeling". It was informative, but unfortunately not practical for me since it relies on having a quadratic program solver. "Linear programming" and "quadratic programming" are new to me, and so I have spent the previous few days learning the basics. Hopefully this will be enough to get through the next article I am planning to read, also by David Baraff, titled " Fast Contact Force Computation for Nonpenetrating Rigid Bodies". From what I have read, the method described by it does not require solving an optimization problem, so it should be a lot easier to implement. Artist's EaselWritten by GreyKnightiScribble Sketches #28(Click to enlarge)
(Click to enlarge)
Community SpotlightWritten by jaythemageWith anticipation about the SAO update on the rise, some members are taking the time to create some mods while the current version is still the only version of the game. Funny Quote of the WeekFrom the online chatBackground information: "neko" is the Japanese word for "cat". Jay: If a single humanoid alien attacked your hometown and was destroying everything it saw with super lazer beams from its eyes, and told you that you could take one thing out of your room to battle it, what would you take? InvisibleMan: Err, the SNES I guess. It can't be used for anything else Jay: I think I'd take one cat from each of my houses Jay: Assuming I get one thing from each of my rooms InvisibleMan: So you'd be kind of like a necromancer? Jay: Heh, more like nekomancer
|
|
|
|
« Last Edit: November 18, 2010, 06:51:23 PM by IfThenSoftware »
|
Logged
|
|
|
|
|
IfThenSoftware
|
 |
« Reply #19 on: December 02, 2010, 05:28:39 PM » |
|
NewsVersion 1.2.5 of Stick Adventures Online has been released. In this update, the in-game chat has been replaced by the web-based chat, a help button has been added, and the ban list has been cleared. Development has finally started again for Stick Adventures Online. The game is being recoded from the ground up. This update is being called "SAO: Redux". From the ProgrammerWritten by InvisibleIf you are writing a physics engine, I highly recommend reading Nonconvex Rigid Bodies with Stacking. It's easy to read for the most part, and really helped tie up some loose ends for me. I implemented the described method, except without using a contact graph and shock propagation (friction was also omitted). The resulting physics engine was far from perfect, but gave me that final bit of information I felt I was missing. I believe I now have enough experience with writing physics engines to write the simple one which SAO will use. I'm currently in the process of recoding SAO. I have a movable camera and character working, as well as jumping and collision with one-way and solid platforms. The trick to getting one-way platforms to work correctly is to check if the character was intersecting the platform at the beginning of the timestep. If so, let him fall the rest of the way through it. If not, block movement if the character is currently intersecting the top of the platform and is moving downwards.  Currently the game is only showing what it "sees". This makes it easier to debug. I am currently adding in the background layer though, so graphics are coming soon. If you are interested in trying SAO: Redux as it is being developed, feel free to stop on by the online chat and ask for the latest demo. Artist's EaselWritten by GreyKnightiScribble Sketches #29(Click to enlarge)
(Click to enlarge)
Community SpotlightThere is no community spotlight article this week. If you have anything you would like to say in the next community spotlight article, please post it here. Funny Quote of the WeekFrom the online chatInvisibleMan: Wow, I may have set the terminal velocity a bit too high InvisibleMan: At this rate, your character will move the world when he hits
|
|
|
|
|
Logged
|
|
|
|
|
IfThenSoftware
|
 |
« Reply #20 on: December 09, 2010, 03:12:29 PM » |
|
NewsThe latest demo of SAO: Redux is version 24. If you are interested in trying SAO: Redux as it is being developed, feel free to stop on by the online chat and ask for the latest demo. From the ProgrammerWritten by InvisibleSAO: Redux now has graphics other than squares, lines, and arrows. Getting the background to scroll correctly was a bit of a challenge, but handling world space like a 3D space helped solve the issues. The homogeneous divide step was the main bit I was missing, although I did have to scrap most of my original idea (handling the background as a separate "space" did not work out at all). In the current demo there are multiple characters: two stickmen, one pollenator, and one stinkbug. To help find problems, the user can plug into the characters the same way a client or AI would and control them. People seem to be particularly fond of flying the pollenator around the map. This way of handling characters is new for me, and I am rather excited to see how well it works out once I need to write AI. I spent the previous couple days working on a new state system. Unfortunately, I was unable to find a cleaner way to represent states. The states which exist are too intertwined to easily separate them into only a few groups, which was my plan. I ended up using the same state system, although I have reorganized the code to make certain parts clearer. I also added a couple new states, and improved the state handling when walking. The world update code is still in need of some serious refactoring, but that will probably have to wait until there is more code to work with. Be sure to checkout the community spotlight article for a video showing off the latest SAO: Redux demo. Artist's EaselDrawn by GreyKnightiScribble Sketches #30(Click to enlarge)
(Click to enlarge)
Community SpotlightWritten by jaythemage If you have anything you would like to say in the next community spotlight article, please post it here. Funny Quote of the WeekFrom the online chatpifreak: this shushie is awesome InvisibleMan: "shushie"? pifreak: http://en.wikipedia.org/wiki/Slush_%28beverage%29InvisibleMan: Oh, you mean a slushie? pifreak: that's what I said pifreak: oh xD
|
|
|
|
|
Logged
|
|
|
|
|
IfThenSoftware
|
 |
« Reply #21 on: December 17, 2010, 10:11:05 AM » |
|
NewsThe latest demo of SAO: Redux is version 28.3. If you are interested in trying SAO: Redux as it is being developed, feel free to stop on by the online chat and ask for the latest demo. Changes since version 24: -WASD can now be used to walk/crawl/fly around. -Numpad 0 can be used to jump. -Numpad 1 can be used to equip/unequip a potion. -You can now punch by left-clicking. -The stuck-drinking bug should be fixed. -An equipped potion can be thrown by right-clicking. Hold down the right mouse button to aim. From the ProgrammerWritten by InvisibleThis week I added punching and potion chucking, although the latter still needs some work. I also spent some time refactoring the code. Rather than having the state integration and rendering code in the same class, I've split them into separate classes. This is a step in the right direction for supporting multiple CPU cores, although there would likely be little if any gain with the current setup. Currently, the state would need to be locked every time it needs to be rendered. This would effectively eliminate any gains from multithreading. When I start to seriously consider supporting multiple cores, I will need to find a way of fixing this. I have spent the past couple days researching other collision detection methods. They would (in theory) allow sloped ground. However, it's unlikely that I will use these methods in SAO: Redux, due to time constraints; I don't want to work with experimental code if I can avoid it. They will probably appear in future projects though, most notably Merki. Artist's EaselDrawn by GreyKnightiScribble Sketches #31(Click to enlarge)
(Click to enlarge)
Community SpotlightWritten by jaythemage If you have anything you would like to say in the next community spotlight article, please post it here. Funny Quote of the WeekFrom the online chatsambi is going 2 choressambi: brb InvisibleMan: Finally! Acaceol: Lol at the three above lines InvisibleMan: I just finished proving algebraically that physics problem InvisibleMan: And yeah, now that I look, that wasn't the best time to shout that :|
|
|
|
|
|
Logged
|
|
|
|
|
IfThenSoftware
|
 |
« Reply #22 on: February 03, 2011, 10:14:34 AM » |
|
NewsThe crew at MMOVoices interviewed our programmer (InvisibleMan) in their latest podcast episode: http://www.ifthensoftware.net/forums/index.php?showtopic=2187From the ProgrammerWritten by InvisibleWhat was originally a small detour into studying finite state machines has completely redirected development. Due to the spaghetti code which was SAO state handling, I started researching finite state machines. The idea is that a finite state machine would clean up the code and make it easier to read, and bugs would be easier to detect as well. If you want to know more about finite state machines, I highly recommend these two articles: UML State Machine on Wikipedia and Finite State Machines (FSM) by Jason Brownlee. The FSM system which I wrote involves a main CStateMachine class, a base CState class, a CTransition class, and a CEvent class. There are also some derived state classes, namely CStateTopSimple, CStateTopComposite, CStateSubSimple, and CStateSubComposite. CStateMachine stores the root state, and manages the initial event processing. CState, CTransition, and CEvent are what you would expect them to be; they represent and manage a state, a transition between states, and an event respectively. The derived state classes are there mainly to make the code easier to both read and write by automatically setting default values and ignoring certain features of the base state class. A state can have multiple transitions attached to it, which are triggered by events. An explicit FSM like what I just described is certainly useful, but it's a bit too much for managing character states in Stick Adventures Online. Because of this, I will be trying out an implicit FSM in one or two test projects. After I have experience using an implicit FSM, I will be returning to work on SAO: Redux. An implicit FSM is very similar to how I have been coding state handling already. However, with my experience in writing and using an explicit FSM, I should be able to write better state handling code. I have also decided to scrap the engine and start from scratch. Like with FSMs, I now have more experience which means I can probably write an engine faster and better than I could before. There are some problems with using an engine for a long time. One problem is that you forget the original reason for a feature, for example the garbage collection system; it is intended to allow generic RAII and automatic management of memory, so it does not need to be used if these features are not required. Another problem is that the engine was written with less experience and knowledge, possibly made worse by later additions which piled more recent knowledge on top of the old, possibly bad, designs. At any rate, I will be working on at least one test project before getting back to SAO: Redux. Just like with Redux though, I will probably release builds of these projects to people who are in the online chat. Artist's EaselDrawn by GreyKnightiScribble Sketches #32(Click to enlarge)
(Click to enlarge)
Community SpotlightWritten by willl and jaythemageAnticipation arises as we wait for SAO:Redux demo 29. With the production of demos halted at the moment, many members are beginning to feel uneasy and think that Invisible has stopped working on SAO: Redux. Though that is not the case, many (typically younger members) tend to flame InvisibleMan and ITS saying that they could make a game like SAO a lot faster than this. Some of them try, fail to do so, and apologize; others ragequit and end up coming back later for any updates. If you have anything you would like to say in the next community spotlight article, please post it here. Funny Quote of the WeekFrom the online chatpifreak: An Easter-egg I found on accident: hit F5 in notepad. It inserts the current date and time! InvisibleMan: Edit->Time/Date F5 pifreak: cool, they hid the Easter egg in the menu <.>
|
|
|
|
|
Logged
|
|
|
|
|
IfThenSoftware
|
 |
« Reply #23 on: February 18, 2011, 11:59:59 AM » |
|
NewsThe first demo of our test project (a vertical scrolling SHMUP) has been released. For details, click here. From the ProgrammerWritten by InvisibleStarting fresh without any wrappers around the APIs has been interesting. The code is actually a lot simpler, and I spend more time working on the actual game rather than the engine. This has led me to wonder if the "game engine" which people sometimes talk about is actually a game specific framework, not a collection of generic wrappers and utilities. I have decided to use exceptions for error handling. This would also allow me to catch any other exception and report it in a more user-friendly way (although I have not taken advantage of this yet). The exception class is pretty basic; just a message and a constructor which accepts a variable amount of arguments and constructs the message using vsprintf(). I have plans to create my own error reporting system which generates the crash dump and sends it to an error reporting server, but this will probably have to wait. All transformations are now handled by Direct3D. Besides some tests with 3D graphics, this is the first time I have written a game without using pre-transformed and lit vertices. This makes the code a lot cleaner and easier to write. I do have a tip for anyone attempting this though: If you do not have any lights, make sure lighting is turned off. I spent multiple hours debugging the rendering code before I realized that the graphics were invisible because they weren't lit. Another nice thing about letting Direct3D handle transformations is that it is really easy to add parallax scrolling; simply place the layers infront of the camera and move the camera around. I spent some time over the last couple weeks learning about aeronautics. Because this is the first SHMUP I have worked on which is not in space, the only way to get it "feeling" right is to learn how planes fly in real life. I don't feel like I have learned the subject well enough to teach it, so I won't be discussing my findings here. However, if you are interested in learning about aeronautics, I recommend the following article: Aerodynamics in flight: flight principles applied to airplanes. The game ended up using air resistance, banking, and multiple thrusters to get the ship moving in the right direction. Not completely accurate, but close enough. Artist's EaselDrawn by GreyKnightiScribble Sketches #33(Click to enlarge)
(Click to enlarge)
(Click to enlarge)
Community SpotlightWritten by jaythemage If you have anything you would like to say in the next community spotlight article, please post it here.
|
|
|
|
|
Logged
|
|
|
|
|
IfThenSoftware
|
 |
« Reply #24 on: February 24, 2011, 01:15:03 PM » |
|
NewsThe second demo of our test project (a vertical scrolling SHMUP) has been released. For details, click here. Forum account registration has been temporarily disabled. http://www.ifthensoftware.net/forums/index.php?showtopic=2197From the ProgrammerWritten by InvisibleTo make it easier to create the background images, our artist GreyKnight requested that I create a tool for him. This tool would allow him to create the rough outline of the terrain by stacking blocks. Blocks would be stacked by clicking the mouse over the area where you want the block to be placed, and it would appear at the top of the stack at that location. Blocks would then be removed in a similar fashion by right-clicking. Unfortunately, I seem to be cursed when it comes to tool development (just ask GreyKnight about the map editor I created for Volund). Things started out fine; the base framework was put together in a few days and I didn't run into any problems. However, I hit something of a brick wall when I tried to implement the mouse control. The original plan was to have things set at an isometric angle, but I quickly realized that due to the variable height of the terrain, this would require a 3D mesh of the terrain in order to figure out where the mouse was (ray vs. triangle mesh). In an effort to simplify the problem, we decided to make it top-down but at a slight slant. Loradon and Volund both used this view angle, but the height and angle were faked by the artwork. This change helped simplify the camera setup, but still required a 3D triangle mesh. One solution, which we are currently considering, is to not use the mouse. This would allow me to use an easy to keep track of position, and alter whatever is at that position when another key is pressed. Artist's EaselDrawn by GreyKnightiScribble Sketches #34(Click to enlarge)
(Click to enlarge)
Community SpotlightWritten by jaythemageDocumenting the progress of Ifthen Software's SHMUP in video format, Jay (a community member) created a video of the latest demo.  If you have anything you would like to say in the next community spotlight article, please post it here.
|
|
|
|
|
Logged
|
|
|
|
|
IfThenSoftware
|
 |
« Reply #25 on: March 04, 2011, 07:12:28 AM » |
|
NewsThe third demo of our test project (a vertical scrolling SHMUP) has been released. For details, click here. Forum account registration has been reopened. http://www.ifthensoftware.net/forums/index.php?showtopic=2201From the ProgrammerWritten by InvisibleWe have postponed the heightmap tool which I discussed in the previous newsletter issue. This is good news for me, since I can work on the fun stuff (destroying alien ships) and I don't need to worry about the problems with the tool yet. Our artist doesn't need to work on backgrounds right now, so this shouldn't hurt that side of development. So yes, I worked on making it so that you can destroy alien ships. I personally think that it turned out quite nicely, and have been found to sit and constantly kill aliens just for the fun of it. Feedback is part of the reason why they are fun to kill. When your projectiles hit the alien, it jerks back from the impact and the projectile seems to encounter the alien and explosively disperse into and around it. When the alien reaches about 30% of its health, there is an explosion inside of it which causes visible damage. And there is a final explosion when the alien is destroyed. More can be done of course, most notably the addition of sound effects, but it works well so far. I ran into a couple problems while making it possible to destroy alien ships. The first one I remember involved a lot of debugging and turned out to be a somewhat embarrassing oversight. Your ship's projectiles would appear inside of the alien ship for an instant before colliding with it. The alien's collision area is large enough to prevent this kind of problem, so that wasn't the issue. The next thing I investigated was the depth of the projectile with respect to the alien ship; maybe Direct3D was translating it a bit further than I was expecting due to depth? This was an issue with other things, but it apparently wasn't causing the present problem since the projectiles were given the same exact depth as the aliens and they still penetrated too far. I eventually thought to check if collision detection was being performed after movement, and found that it wasn't. Because of this, the projectile was allowed to penetrate the alien ship for a single state (one or two frames) before it was finally detected and removed. The other issue wasn't a bug, but it was a task I hate dealing with: orientation interpolation. States are interpolated by the renderer in order to ensure that there is no "jitter". The "jitter" is caused by an accumulated extra amount of time when updating at a fixed time-step; you eventually create multiple frames at once, and the screen appears to "jit" because of this. Interpolation is easy, but you run into trouble when you try and do it with Euler angles. One of the issues is that you could spin around multiple times before reaching what it thinks is the correct destination angle. Another issue is that the interpolation code may interpolate in the wrong direction. Fortunately, 3D Math Primer for Graphics and Game Development has a section dealing with this issue, 10.3.4 page 156 which describes a solution. I recommend reading that section for a proper description, but it boils down to limiting the angles to within 360 degrees (-180 to 180 is what the book uses) and calculating which direction is the shortest path to the destination angle and using that to interpolate. I am currently tackling the problem of how to control the alien ships. One idea involves springs, and the other involves a destination position and AI which directs the alien towards that point. I might discuss this in more detail in the next issue, by which point I should have this solved. Artist's EaselDrawn by GreyKnightiScribble Sketches #35(Click to enlarge)
(Click to enlarge)
Community SpotlightWritten by jaythemageJay has once again made a video featuring the latest demo of Ifthen Software's SHMUP.  If you have anything you would like to say in the next community spotlight article, please post it here.
|
|
|
|
|
Logged
|
|
|
|
|
IfThenSoftware
|
 |
« Reply #26 on: March 10, 2011, 10:08:00 AM » |
|
NewsThe fourth demo of our test project (a vertical scrolling SHMUP) has been released. For details, click here. From the ProgrammerWritten by InvisibleI spent the majority of last week working on the alien ship's movement. They needed to enter the screen and then circle around in front of the player's ship, both in an effort to avoid the player's shots and to hit the player's ship with their own projectiles (a moving target is difficult to hit). There are several ways you can go about this, and it took me a while to both discover those systems and try them out. These are some of the systems which I found: track, track and spring, move commands, waypoints, and a waypoint track. TrackWith this system, the alien ship would be on a fixed track. This fixed track would most likely be determined offline by the designer. The ship has a specific shape which it is following, setting its position to exactly match that shape. For example, if you wanted the ship to fly down the screen from the top to the bottom, you would use a line beginning at the ship's starting point and ending at the bottom of the screen. The most useful shapes would probably be lines, line segments, circles, ellipses, and curves. These shapes could be strung together to make more complicated shapes, and thus more interesting movement patterns. The disadvantage of this system is that the ship will be very rigid. For example, you can't knock the ships back when they get hit by a projectile. This could be solved by using an animation to give the illusion of the ship being knocked back. Track and SpringA modification to the track system. This method attaches the ship to the track with a spring. The spring fixes the inflexibility issues which the track system had, allowing ships to be knocked back, and jostled around in general. The spring causes the ship to... Well, spring back to where it is supposed to be. Unfortunately, this can cause the ship's movement to become too bouncy, flinging the ship back and forth as the track it is on curves this way and that. This is the system I ultimately decided to use, but I made the springs heavily dampened to prevent excessive bouncing. Move CommandsWith this movement system, you have an AI which controls each alien ship in the same way that the player controls his ship. The AI examines the state of the game and decides which way the ship should be moved. Once the AI knows what it wants to do, it sends the appropriate commands to the ship it is controlling, just like the player sends commands to his ship by pressing keys on the keyboard. This will ideally result in the best possible movement. The main disadvantage with this system is that the AI can be very difficult to program. I tried this system, but coding the AI would have been too big of a job for this project. WaypointsEach ship has its own list of waypoints. These waypoints form the shape that the ship should move in, and can be easily updated to reflect changes in the game. For example, the alien ship can follow the player's ship simply by having its waypoints move along with the player. The alien ship has its velocity set so that it moves towards its next waypoint. When that waypoint has been reached, it moves on to the next, and the next, etc. A waypoint list can either loop around when the end is reached, or load another waypoint list. Being able to load different waypoint lists makes movement more flexible, and editing the waypoints list in real-time is easier. This system is flexible enough to allow the ship to be jostled around as much as you want, and it will still make its way towards its target. The disadvantage to this system is that it forms rather rough and jagged paths. You can smooth them out by adding more waypoints, but it will be difficult to get it as smooth as it would have been if a track had been used. Waypoint TrackThis is a combination of the track system and the waypoints system. Basically, you have a waypoints list which contains a single waypoint, and the list is set to loop. This waypoint is moved along the track as long as the ship is at the waypoint. I did not get the chance to try this exact system myself, but it seems like a "best of both worlds" solution. Unlike the track system, this allows the ships to be knocked around. This also takes advantage of the smoothness which the track system provides. This could be thought of as a very dampened track and spring system, but you do not need to worry about the high accelerations which are caused by being too far from the track. I am sure this is not a list of every single option available, but I hope it helps anyone who is currently interested in this. Another thing to keep in mind when choosing a movement system is how you want the game to feel, and how the ships should act. If the ship is a scary attack drone, using a very fast speed and the waypoints system would give the effect of sharpness and decisiveness. Artist's EaselDrawn by GreyKnightiScribble Sketches #36(Click to enlarge)
(Click to enlarge)
Community SpotlightWritten by jaythemageAnother week, another video; Jay has created yet another video showing off the latest SHMUP demo:  If you have anything you would like to say in the next community spotlight article, please post it here.
|
|
|
|
« Last Edit: March 10, 2011, 10:20:28 AM by IfThenSoftware »
|
Logged
|
|
|
|
|
IfThenSoftware
|
 |
« Reply #27 on: March 18, 2011, 01:26:29 PM » |
|
NewsThe fifth demo of our test project (a vertical scrolling SHMUP) has been released. For details, click here. From the ProgrammerWritten by InvisibleThe heightmap tool is finally finished! Since I decided to use the arrow keys rather than the mouse to move the tile selector, the tool was completed easily. The tool isn't very well optimized (every tile in the map is being rendered) but it runs fast enough to get the job done. The one tricky bit I ran into was making the selector turn green when behind tiles. I eventually got it to work by checking for intersection between the selector and any tiles with the same x coordinate as it, but a lower y coordinate (in map space, not screen space). The one big feature I added to the SHMUP was the mission selection screen. The dotted lines in particular were somewhat difficult to code. I ended up storing a dotted line graphic in a texture, which is then attached to a quad. One end of the quad is attached to the mission's starting point and the whole thing is rotated around to point at the mission's destination. The angle for this rotation is calculated by taking the dot product between the unit vector pointing from the mission's initial position to its final position and the unit vector i=(1, 0). This dot product is the cosine of the angle between the two vectors, so the angle is calculated by using acos(). This will only return an angle between 0 and 180 degrees though, so we need to figure out which half it is in. This is done by performing another dot product, this time against the unit vector j=(0, 1). If this dot product is less than 0, the following is used to recalculate the angle: angle = PI + (PI - angle). The line changes its length by modifying the width of the quad based on a "path progress" percentage. I will probably change that last bit in order to get a certain effect though. Artist's EaselDrawn by GreyKnightiScribble Sketches #37(Click to enlarge)
(Click to enlarge)
Community SpotlightWritten by jaythemageIn the past few weeks, several players have begun playing Volund. The source of this income of players is unknown, but we are glad they decided to play. Jay made another video spotlighting the SHMUP:  If you have anything you would like to say in the next community spotlight article, please post it here.
|
|
|
|
|
Logged
|
|
|
|
|
IfThenSoftware
|
 |
« Reply #28 on: March 24, 2011, 11:35:03 AM » |
|
NewsThe sixth demo of the SHMUP has been released. For details, click here. The SHMUP is now officially an IfThen Software project. http://www.ifthensoftware.net/forums/index.php?showtopic=2231. From the ProgrammerWritten by InvisibleLast week I was stuck on what should have been a simple problem: Calculating the time at which two objects will intersect. The objects in question have constant velocity, so that helps simplify things a bit. My original plan was to set both object's motion formulas equal to each other and solve for time. This would have worked splendidly, if not for the fact that division is undefined for vectors... It was impossible to get time alone on one side of the equation. The breakthrough which helped me finally solve this problem was the realization that both objects are moving parallel (along the same line). This allowed me to get rid of the vectors and use the well known equation d = r*t. In order to use that equation, I needed one of the objects to be stationary so I calculated the relative velocity of one of the objects. vrel = va - vb vrel is the relative velocity of object a with respect to object b. So the final equation became: t = |( rb - ra)|/| vrel| where ra and rb are the positions of the objects. I still don't know how I would handle this if the velocities are not parallel. I'll have to tackle that eventually, so you may be able to read the solution in a future newsletter issue. It appears as though the alpha component of specular is not added to the color like the red, green, and blue components are. This was unfortunate, since a certain visual effect was depending on it. We eventually got a similar effect in another way though. From what I have read, the alpha component is largely (and possibly only) used for fog calculations. It is possible that this could be taken advantage of and used to get the desired effect, but I did not have enough time to research that. It is worth keeping in mind though. Artist's EaselDrawn by GreyKnightiScribble Sketches #38(Click to enlarge)
(Click to enlarge)
Community SpotlightWritten by jaythemageFor the latest SHMUP demo, Jay created yet another video:  If you have anything you would like to say in the next community spotlight article, please post it here. Funny Quote of the WeekFrom the online chatace: I'm hanging up a sweater, and my closet is organized from most like a trench coat (a trench coat) to least like a trench coat (a travel toiletries case that functions as a gameboy case)
|
|
|
|
|
Logged
|
|
|
|
|
IfThenSoftware
|
 |
« Reply #29 on: April 10, 2011, 03:44:37 PM » |
|
NewsThe seventh demo of the SHMUP has been released. For details, click here. From the ProgrammerWritten by InvisibleNow that the SHMUP has been in development for a while, it's starting to get a bit texture heavy. Because of this, some users have been unable to run the game due to a lack of video memory. My initial attempt at solving this was to load textures into system memory after video memory runs out. Unfortunately, your graphics card needs to support rendering with textures in system memory for this to work. This seems to be a somewhat rare capability, so I ended up scrapping the code. The proper way to solve the memory issue is to load textures only when they are needed and unload them when they are not. In the last demo, we added the ability to fire missiles at the enemies. I experimented with steering to control the missiles, but that didn't feel quite right. The method I eventually settled on was to generate the missile's velocity based on its heading. If the missile is not flying straight for the target, its heading is gradually adjusted until it is. This sometimes causes the missiles to circle a target for a long time, but that can be fixed by increasing the missile's rate of turn. The game will no longer freeze when you press one of the alt keys. For those wondering how to do this, it's pretty simple: All you have to do is handle the WM_SYSKEYDOWN message when it is for the VK_MENU key. If you are creating the trail for something (such as a missile) by placing particles behind it, you should keep in mind that if the rate of placement is greater than the update rate of the game you will need to place multiple particles per frame. If multiple particles have to be placed per frame, you need to interpolate the position of whatever they are following otherwise they will all bunch up in one spot. As I said in a previous issue, I had to tackle the problem of calculating the intercept time and vector for your ship's mission screen blip to one of the mission blips. And as I predicted in said issue, this was rather difficult. I finally found a post on the GameDev forums which discusses how to go about this. You can find the post here. The breakthrough for me was that the distance your ship travels in the interception time is equal to the distance between the mission blip at that time and your ship at the initial time. This provides the necessary equation to find the time of interception since only scalars (distances) are required. Calculating the intercept vector once I had the time of interception was a simple matter of getting the vector between your ship's initial position and the mission blip's final position (at the time of interception), normalizing it, and scaling the resulting unit vector by the speed of your ship. The code for the SHMUP is starting to become too cumbersome to easily change. Mostly due to the way it is structured, compiling and linking takes between three and four minutes to complete. Because of this, I have spent the past week experimenting with new techniques. The first thing I wanted to get straight was the difference between the "game logic" step and "physics" step. After a little research and several discussions with other programmers, the following definitions seem to be commonly used: "Physics" is any code which moves things (this includes collision detection and response) and "game logic" is code which regenerates a character's health, counts down the timer on a trap, shoots a gun, etc. These definitions get a bit blurry if you think through each action too much (shooting a gun is technically movement since your character is moving his finger on the trigger and the internals of the gun are moving) but the following rule should help define the line better: If the movement literally takes place in the game, it's physics; otherwise, it's game logic. For example, if your character does not actually move his finger to squeeze the trigger, and the internals of the gun do not actually move, then it is game logic. Sure these could be animations, but if that is all they are (they aren't separate movable entities which trigger the various parts of firing a gun) then they do not belong in the physics step. With those definitions squared away, I was able to work on a new code structure. The code is split up into systems, game states, and utilities. The systems include debug, render, window, main, and input. Utilities are things such as an interpolation macro and an exception class. Examples of game states are banner, menu, and game. Each game state is split up into input, state, and render. State is further broken up into physics and game logic. A game state could also be split up into UI and game sub-states, but I haven't experimented with this yet. The idea behind this structure is to separate the code to make the addition of features easier (because it is more obvious where the feature belongs), make debugging easier, and reduce compile+link times. I may have to cut out some of this structure in the end though, since adding structure to code also makes it more complicated. Artist's EaselDrawn by GreyKnightiScribble Sketches #39(Click to enlarge)
(Click to enlarge)
Community SpotlightWritten by jaythemage and miotatsuMiotatsu has written a detailed tutorial on how to setup WINE to run IfThen Software games. You can find it here. The seventh SHMUP Demo has been accompanied with a Youtube video by Jay showing the new features:  If you have anything you would like to say in the next community spotlight article, please post it here.
|
|
|
|
|
Logged
|
|
|
|
|