A taste of things to come in Warbots BETA 2.0...

Published November 10, 2009
Advertisement
Edited Nov.11.2009 - Added a quick aside on Artificial Intelligence: flocking, evasion, targeting, objective/order evaluation, etc. A much bigger AI update will be posted soon...just click the 'Comments' link at the end of the post...then scroll down view early code and debug screenshots. Now on with the regularly scheduled journal update....

Hey guys, I guess I'm reverting to my old ways of one journal update a month :-o I've got a lot of stuff to show & tell lol. If you're on some kind of metered internet access you might want to bail out right about now. [ btw. almost @ 700,000 journal views, thanks a lot guys! ]

Overview
It has been about 3 months since the release of Warbots BETA 1.0 - I'm putting the finishing touches on the Beach Assault map , and all the new features that will be included in the next public BETA release. I wanted to have it done by the end of last month, so I'm a little behind - but still very happy with how things are progressing.<br><br>Here is the list of things I've been working on since the last journal update<br><i><b><br> - Human Squad AI logic<br> - Procedural GPU fire rendering <br> - Robot AI logic<br> - Attacking robots [blue team ] spawn on landing craft / defensive spawn on respawn pads [ red team ].<br> - Updated water effect and added 3D 'shore' sea-foam effect to blend water/terrain.<br> - 'Flipped a switch' and got instantly improved terrain, 4-5 layers with full color/normal/spec including detail normal-mapping. More on this later in the post.<br> - Dense swaying/animated instanced grass.<br> - Team switching functionality<br> - Red spawn points on beach<br> - Red defense turrets on top of defensive pillboxes<br> - Human squad rank system<br> - True per-pixel motion blur<br> - Optimization of rendering and game logic, yielding net 20-40% FPS increase.<br> - 1000s of tiny fixes / changes…<br></i></b><br><br>I've got most of the low-hanging fruit in the optimization area, and fixed 100s of bugs that were in the previous BETA release already. I've got a full list but I'll spare you.<br><br><b>I will have some HD videos soon + 1920x1080 4xFSAA screenshots - followed by the release of public BETA v2.0 in the coming weeks, so stay tuned!</b><br><br>Now on to the screenshots / individual items I've been slaving over ;-) <br><br><br><b>Dense animated grass / spawns,turrets,installations / new terrain / etc.</b><br>I've made a lot of visual improvements to everything, here is a splattering of screenshots some of the new stuff - <br><br>All this stuff comes at a 20-40% net speed increase since I did a lot of optimizations on the game engine….<br><IMG SRC="http://www.radioactive-software.com/warbots/Beach_Assault_early5.jpg" border="0"><br><IMG SRC="http://www.radioactive-software.com/warbots/Beach_Assault_early4.jpg" border="0"><br><IMG SRC="http://www.radioactive-software.com/warbots/Beach_Assault_early3.jpg" border="0"><br><IMG SRC="http://www.radioactive-software.com/warbots/Beach_Assault_early1.jpg" border="0"><br><IMG SRC="http://www.radioactive-software.com/warbots/Beach_Assault_early2.jpg" border="0"><br><IMG SRC="http://www.radioactive-software.com/warbots/Beach_Assault_early8.jpg" border="0"><br><IMG SRC="http://www.radioactive-software.com/warbots/Beach_Assault_early7.jpg" border="0"><br><IMG SRC="http://www.radioactive-software.com/warbots/Beach_Assault_gun1.jpg" border="0"><br><br><br><br><b>Detailed terrain rendering/shading … and how I suck at life.</b><br>So this is probably one of the most embarrassing moments of my gamedev life over the last 10 years…apparently as far back as the first BETA release of Warbots all complex terrain shading has been DISABLED, the calculations were being done but not factored into the final output color in the terrain pixel-shader correctly. The ambient occlusion, nDotL self shadowing, and the other minor/ambient terrain elements were being included correctly, just not the normal/specular lighting components ;-o<br><br>So one extra multiplication unlocked a world of terrain seksyness…with NO performance decrease since I was already doing the calculations just not outputting them correctly. Ugh. Not my finest hour, but still I'll take it!<br><br>Incidentally I was playing around with the recently released Unreal3 Dev Kit[UDK] on one machine/monitor and comparing their terrain to mine when I realized something was wrong with my rendering. I notice they use about 4-5 layers on the terrain in Unreal3, and no specular maps for each layer. I on the other hand use colored specular maps per-layer[ in addition to normal/color maps per layer ], and include an extra layer than they do if my eye is correct. I also include detail normal mapping [ extra tiling / sampling of the per layer normal map ].<br><br>The improvements are visible in all the above screenshots, but I'll include a close-up of a rocky/muddy ditch….<br><br>For reference the object in the very left side of the screen is a tree trunk base…so there is a lot of detail here ;-) I'll be posting more screenshots of the 'new' terrain as the BETA #2 release nears.<br><br><IMG SRC="http://www.radioactive-software.com/warbots/Detailed_terrain_shading.jpg" border="0"><br><br><br><br><b>Team selection / Construction Cave finalized</b><br>I finalized the robot construction menu …<br><IMG SRC="http://www.radioactive-software.com/warbots/Team_Selection_Cave.jpg" border="0"><br><br><br><br><b>True per-pixel motion blur</b><br>Based off the GPUGEMS3 article…I actually 'invented' it but then saw the method has already been published. Eh…it works pretty well, but I doubt I'll enable it by default<br><IMG SRC="http://www.radioactive-software.com/warbots/MotionBlur1.jpg" border="0"><br><br><br><br><b>Human AI Logic / Ranks / Squad AI / etc.</b><br>I've made some great advances in terms of squad based AI, and pathfinding…the soldiers will be used to capture command points so their AI is very important. The player can exit their Warbot to capture command points / bunkers - but it's easier to let the AI soldiers do it. There can be up to 1000 soldiers/humans per map.<br><br>Since it's kind of hard to show AI via screenshots - I've got some screens of the soldiers [lit/un-textured]. I'm starting to integrate the new animations, they are all in the game I'm just building the soldier state machine to support all types of animations and good stuff.<br><br><IMG SRC="http://www.radioactive-software.com/warbots/Ambient_soldier_shading1.jpg" border="0"><br><IMG SRC="http://www.radioactive-software.com/warbots/Ambient_soldier_shading2.jpg" border="0"><br><IMG SRC="http://www.radioactive-software.com/warbots/Ambient_soldier_shading3.jpg" border="0"><br><br><br><br><b>Misc. screenshots AND INDSIDAR INFOMATION :-o</b><br>A new game I'm working on, called 'Reference Texture' :-p Actually this is output of a mode in my game engine where I'll only load a 16x16 texture in the place of all regular textures. This keeps total app memory usage < 256MB. I can see this being helpful to test on low end machines.<br><br>Plus I think it looks pretty trippy :-o<br><IMG SRC="http://www.radioactive-software.com/warbots/Reference_Texture_Mode.jpg" border="0"><br><br><br><br>Night rendering…artillery coming in, with the spotlights in the background…<br><IMG SRC="http://www.radioactive-software.com/warbots/NightScreen1.jpg" border="0"><br><br><br><br>Sunset … more screenshots of the sunsets / beach / etc coming soon<br><IMG SRC="http://www.radioactive-software.com/warbots/Beach_Assault_early9.jpg" border="0"><br><br><br><br>Pause of some action…<br><IMG SRC="http://www.radioactive-software.com/warbots/BeachAssaultPause1.jpg" border="0"><br><br>First person mode, I ordered the robot to drive through the crowd ;-) This screenshot has the OLD terrain rendering method, for comparison.<br>Vehicle pwnage…<br><IMG SRC="http://www.radioactive-software.com/warbots/Vehicle_pwnage.jpg" border="0"><br><br><br><br>Until next time. And as usual I could use any feedback on this stuff…<br><br> - Dan<div> </div>
0 likes 6 comments

Comments

Aardvajk
Wow. Further words fail me [smile].
November 10, 2009 01:10 PM
dgreen02
Quote:Original post by Aardvajk
Wow. Further words fail me [smile].


:-D Thanks.

I just made some good progress since yesterday. I'll copy the new stuff below...

Quick Aside on AI: flocking evasion, targeting, objective/order evaluation
I've made some improvements in the last day or two on the human/squad artificial intelligence, as well as the robot's AI.

Here is some incomplete code/early data structure design, and some images of how it's looking ... no comments on the style please lol...I don't know why I'm even pasting this, I just feel like including some code in an update for once xD

//WO_ArtificialIntelligence.h, (c) 2009 Danny Green, Radioactive-Software.com

#ifndef WO_ARTIFICIALINTELLIGENCE_H
#define WO_ARTIFICIALINTELLIGENCE_H

//ROBOTS
#define MAX_AI_ROBOTS_PER_WORLD MAX_ROBOTS_PER_WORLD //total number of AI robots that can inbahit the world
#define MAX_ORDERS_PER_ROBOT 5 //size of the robots's order stack / number of simutanious orders

enum RobotOrderType 
{ 
	ROBOT_ORDER_STOP_ALL, 
	ROBOT_ORDER_IDLE, 
	ROBOT_ORDER_MOVE, 
	ROBOT_ORDER_ATTACK, 
	ROBOT_ORDER_DEFEND, 
	ROBOT_ORDER_PATROL, 
	ROBOT_ORDER_WAIT_DELAY 
};

enum RobotStatusType 
{ 
	ROBOT_STATUS_NONE, 
	ROBOT_ORDER_ORDER
};

enum SimulatedPlayerType 
{ 
	PLAYER_TYPE_DEFENSIVE,
	PLAYER_TYPE_OBJECTIVES,
	PLAYER_TYPE_KILLS,
	PLAYER_TYPE_AVERAGE
};

//The simulated AI players will just 'give orders' to the robots, this abstracts the interface to where it would be
//very easy to add a 'RTS' command mode
struct RobotOrder
{
 RobotOrderType m_OrderType; //ordinal type
 D3DXVECTOR3 m_Position; //position associated with the order
 char m_Priority; //if required [ determines if the robot will break and return fire if attacked ]
 char m_EnemySquadTarget; //if required
 char m_EnemyRobotTarget; //if required
 double m_TimeDuration; //how long the order should be carried out for
};

//Data structure for a simulated human player
struct SimulatedPlayer
{
 bool m_IsSpawned; //If the simulated player is spawned.
 int m_GlobalIndex; //Global index of the robot, so it can share some data from the main robot array
 SimulatedPlayerType m_PlayerType; //The type of player 
 RobotOrder m_OrderStack; //List
 float m_SkillLevel;  //0.0 being n00b, 1.0 being god-like

 float m_fMovementSpeed; //Movement speed of the robot [ scalar ]
 int m_numNodesToLookAhead; //How far the pathfining should look ahead when setting a waypoint.

 D3DXQUATERNION m_LastOrientationQuat; //Previous orientation of the simulated player, used for blending
 D3DXMATRIX m_Orientation; //Orientation of the simulated player

 D3DXVECTOR3 m_TerrainNormal; //Terrain normal vector under the player

 RobotStatusType m_RobotStatus; //Robot's current status

};


//SOLDIERS / HUMANS


#define NUM_SOLDIERS_PER_SQUAD 16
#define MAX_ORDERS_PER_SQUAD 5 //size of the squad's order stack / number of simutanious orders
#define MAX_SQUADS_PER_WORLD 1+(MAX_HUMANS_PER_WORLD/NUM_SOLDIERS_PER_SQUAD)

enum SquadOrderType 
{ 
	SQUAD_ORDER_STOP_ALL, 
	SQUAD_ORDER_IDLE, 
	SQUAD_ORDER_MOVE, 
	SQUAD_ORDER_ATTACK, 
	SQUAD_ORDER_DEFEND, 
	SQUAD_ORDER_PATROL, 
	SQUAD_ORDER_WAIT_DELAY 
};

enum SquadStatusType 
{ 
	SQUAD_STATUS_NONE, 
	SQUAD_ORDER_ORDER
};

//The soldier squads be given orders by the computer, this abstracts the interface to where it would be very easy to add a 'RTS' command mode
struct SquadOrder
{
 SquadOrderType m_OrderType; //ordinal type
 D3DXVECTOR3 m_Position; //position associated with the order
 char m_Priority; //if required [ determines if the squad will break and return fire if attacked ]
 char m_EnemySquadTarget; //if required
 char m_EnemyRobotTarget; //if required
 double m_TimeDuration; //how long the order should be carried out for
};

struct Squad
{
 //Orders
 SquadOrder m_OrderStack[MAX_ORDERS_PER_SQUAD];
 char m_CurrentOrder; //Current order index

 //Soldier data
 int m_SoldierIndices[NUM_SOLDIERS_PER_SQUAD];

 //Status / info
 char m_Team; 
 SquadStatusType m_Status;

}; 

#endif







Red lines are 'threat' vectors, much more on this later...blue represents squad based objectives, and green lines indicate the soldiers resolved movement vector.




Some showing Vehicle/Robot order completion.


- Dan
November 11, 2009 02:20 AM
Moe
Amazing looking, as usual!
November 11, 2009 05:43 PM
mikfig
Looks damn good!!! *drools*
November 14, 2009 03:37 PM
Matias Goldberg
Your shader compiler must be very bad it didn't optimize away the code that never reaches the output colour (since you're getting the same speed after fixing it).
Cg does that. Are you using HLSL? Make sure you use the D3DXSHADER_OPTIMIZATION_LEVELX flags.

But don't feel ashamed. Yesterday I've discovered some of our shader math written by a colleague was disabled after some refactoring he did, and has been disabled since like a year ago.
We saw a huge quality boost too.

Beautiful, as always.

Use something like PerfHUD to interactively see objects being drawn one by one to spot an object being rendered twice, debug objects that shouldn't be rendered but you don't see because they get hidden, or being drawn in the wrong order

Cheers
Dark Sylinc
November 15, 2009 08:00 PM
dgreen02
Quote:Original post by Matias Goldberg
Your shader compiler must be very bad it didn't optimize away the code that never reaches the output colour (since you're getting the same speed after fixing it).
Cg does that. Are you using HLSL? Make sure you use the D3DXSHADER_OPTIMIZATION_LEVELX flags.

But don't feel ashamed. Yesterday I've discovered some of our shader math written by a colleague was disabled after some refactoring he did, and has been disabled since like a year ago.
We saw a huge quality boost too.

Beautiful, as always.

Use something like PerfHUD to interactively see objects being drawn one by one to spot an object being rendered twice, debug objects that shouldn't be rendered but you don't see because they get hidden, or being drawn in the wrong order

Cheers
Dark Sylinc


Thanks for the advice. I should have clarified the code was actually being used even with the shader flags because I was accessing the result vector for simple/hacked self-shadowing, but not actually using it for what it was meant for in the final color contribution at the end of the HLSL shader :-o [ must have lost it when updating the terrain, months ago ]...

So I get the visual boost with no real hit, except to my ego for not recognizing it... [grin]

Btw...I used to use Nvidia FX composer 2 but now it crashes, and refuses to compile my shaders due to some internal error ... so I use DXSDK flink.exe from the command line to compile my .fx files, and edit in the Visual Studio IDE *sigh*

Thanks for the comments guys!
November 15, 2009 10:49 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement