Tuesday, November 4, 2014

Current project: AI_NPC.lua

This is my AI NPC code.  It's a pretty simple modification of the NPC code to orient the character towards the player, then spit out some text at them when they hit the use key.

ADD TO global.lua:
+ Code Snippet
nsarray = {}
nsarraymaxvalue = 3
nsarray[1]="test1"
nsarray[2]="test2"
nsarray[3]="test3"
ns_def="Default."

FYI, NS=abbreviation for 'npc string'.
As you can see there's an array max value used to define just how many times our loop should cycle.  Then there's a flag passed to an array index via nsarray.  That flag unfortunately for now had to be the health indicator.  I'll work on the code later so the guy won't die when you shoot him (at least easily) but for now this gets the job done.

Then make an AI_NPC piece:

AI_NPC.lua
+ Code Snippet
-- LUA Script - precede every function and global member with lowercase name of script

-- globals
ai_neutral_state = {}

--Mike's Simple NPC script
--You must set the following global variables:
-- nsarraymaxvalue = 3
-- nsarray[1]="test1"
-- nsarray[2]="test2"
-- nsarray[3]="test3"
-- ns_def="default"  
-- Each of these array values correlate to the health of the object.  
-- More can be used.  Default is fallback if it's out of range.


-- init when level first runs
function ai_npc_init(e)
 CharacterControlUnarmed(e)
 ai_neutral_state[e] = "stood"
end

function ai_npc_main(e)
local hastalkedyet
local NPCm
local NPCh 
NPCh = g_Entity[e]['health']

NPCm = nsarraymaxvalue
hastalkedyet = 0

 -- Detect player distance
 PlayerDist = GetPlayerDistance(e)
   
 -- Always looking at player
 if PlayerDist < 200 then
    LookAtPlayer(e)
   if g_KeyPressE == 1 then
    for NPCi=1, NPCm do
        if g_Entity[e]['health'] == NPCi then
            PromptDuration(nsarray[NPCi],1000)
            hastalkedyet = 1
        end
    end
    if hastalkedyet == 0 then 
       PromptDuration(ns_def,1000)
    end
  end
 end
end

Video Example:


Not the best code, I'll admit.  But it does the job.  Enjoy!




Monday, November 3, 2014

General Banter: Why FPS Creator: Reloaded?

Ok, so I know I said I was going to write something about the differences between writing and making games.  That, however, will take a lot more resources and time than I currently have available.

So instead, I thought I'd focus on why I ended up here with FPS Creator Reloaded instead of a different engine.

Don't get me wrong.  I've worked off and on with a number of engines.  Unity is pretty feature rich, albeit it didn't really 'make sense' in terms of code manipulating objects.  I didn't like the cost either; it was tremendously expensive by my standards and what's worse the game assets available on their store were not cheap either.  I mean pricewise it wasn't unexpected but at the same time it was just a lot to swallow.  If you wanted to make a worthwhile game, you had to shell out 1500 dollars.  That's not the kind of cash I had lying around.  The newer price of a monthly fee is pretty nice though and definitely bore consideration.  75/mo is similar to the structure that other engines use.

The Unreal engine is a similar setup, though vastly cheaper and ironically the industry standard. Currently they're doing a deal for like 20 dollars a month and 5% of your gross revenue.  That's pretty impressive and I may (or most likely) will go to that in due time.   The problem here is one of technical complexity.  This is not the kind of engine you want to bang off your ring rust with.

Prior to this I was very familiar with and comfortable with the Lite-C/Acknex A8 engine.  Don't get me wrong, I *LOVE* the A8 Engine.  It's awesome.  So easy to use, the object management is easy to code and intuitive, lite-c is a breeze, etc.  The problems?  Much like Unity, the only version worth a damn is the Pro version.  That's a cool 900 dollars, by the way.  The other huge problem is how absolutely outdated the engine was becoming.  They simply haven't touched it in 3-4 years and without a much needed update, it's simply not worth looking at.

None of the other engines really struck me.  There are plenty of good ones out there, sure, but they just didn't have what I wanted.  A simple, easy to make FPS engine that allowed coding and was reasonably up to date in terms of technology.  That means shaders, terrain, etc.

Enter FPS Creator Reloaded.

FPS Creator has been around a LONG time.  Like ten years long.   It's extremely basic, but it's amazing what has been done from a technical standpoint for a simple engine.  It's also got an extremely long running history where it's been updated over and over.   There have been debacles in the past with the company failing to deliver (FPS Creator X10 was fraught with failure) but overall the core premises in FPS Creator Reloaded were very well thought.  Moreover, the price was right.  I got in the pledging at the top level for eighty dollars.  This was  a steal given the sheer volume of assets I'd be receiving, let alone a shader enabled engine.

So I saw these videos:


And this one:


Both of these intrigued me.  For 80 dollars, I could afford to check it out.  Especially with the lifetime upgrades bundled in.

The engine since then languished after a brief trial period as I waited for further feature deployment. The promise of lifetime upgrades ensured if I simply waited, I'd have what I was looking for.  Now with LUA code implemented, physics, etc it's become a functional enough engine to work with. There's still some glaring faults, but it's saved me massive time in terms of programming an engine myself in lite-c.   The upcoming patch 1.0090 promises massive adjustments in lightmapping, engine performance, etc.  I for one, wait with baited breath.

If in the future I choose to move on to another engine, so be it.  But for 80 dollars what fool couldn't afford to at least keep this constantly improving tool in his toolbox?

Currently the price is 100 for the 'gold' level; if you're interested in a discount coupon, comment or message me.

Friday, October 31, 2014

General Banter: What's new 10/31

So if you're following this blog you'll notice this week I laid back off the reviews for a bit.  This is because there's a huge ramp up by a lot of the developers of TGC content.  I think it has to do with the upcoming 1.0090 update, which is highly anticipated as a big fix for a lot of outstanding problems with the engine.

In the meantime, I've been neck deep in code and made some pretty awesome strides.  The first is an all in one script that handles AI NPC's.  Basically turns the 'neutral' NPC into one who will talk to you.  It runs through an array of strings specified in the globals and then picks one based on a passable value to the individual NPC.  

I also have a much heavier one that can be used as a custom unit script, specifically to make them have multiple responses and even script-able actions.

<insert vid here>


Once I get an answer in the forums over here: 

On my question of invulnerability I will be able to wrap up this script and get it on the store.  A little final testing on the lightning script will work for that one too.  I'm planning on price points of 50 cents USD for the lightning script and 2 dollars for the NPC string scripting.  That one took significant more work, so it gets a higher price.  Given it's flexibility I think people will find it'll be quite sufficient for most of their needs.  With support for I think a maximum of 255 strings, that's a lot of flexibility for NPCs.

I also have a similarly structured inventory control system in the works, though that's going to be tougher to implement without serious delving into the LUA classes present in the game engine.

Tuesday, October 28, 2014

General Banter: My sordid affair with games-making.

First, a little background...

Since I was a small child, I've had an interest in games and games development.  When I was about eight, I received my first 'computer'.  It was a Tandy TRS-80 Color (CoCo).  I remember getting it and having literally NO idea what to do with it.  My mom had bought it for me at a yard sale, probably having no idea what she's set off.  I'd sit there for hours, tinkering with code in BASIC, having little to no idea what I was doing.  I'd make red flashing asterisks on the screen and feel empowered.  Still, I was slowly absorbing the little pieces of what made things go tick.

Nothing like cartridges and a 300 baud modem to get the blood flowing.


At school, we had several APPLE IIGS's running LOGO (Anyone remember that?)  and BASIC. I'd make a little triangle move around and take some of that knowledge home to apply to new and more interesting things.  I don't recall what happened to that Tandy, but I do recall it falling by the wayside when I got my first Nintendo Entertainment System.

From there, I spent several years in the void of video games (ah, nostalgia!) while focusing on computer projects at school.  I knew they interested me and pursued them rigorously.

A lot happened starting around age 12-13.  I cracked my skull open and oddly ever since then I noticed my purely logical thinking went to a sort of logical and abstract form.  My code got weirder.  Less understandable from a flow standpoint to those who'd read it.  But it still always did the job, often in novel ways.

Fast forward a few years...
Around age 15, I'd lost my first REAL PC due to some high phone bills from BBS door gaming. Long distance was clearly not my friend and my mom was not plussed.  She sold the smokin fast 486 DX2 66 to pay the bills.  Then, feeling bad for her now dejected son, she found a diamond in the rough - an original IBM PC XT with two MFM 5MB hard drives.  You can imagine my joy at the downgrade, initially.

Turns out the sucker didn't even work.  I had to dig through the thousands (literally) of pages in the original IBM manuals to figure it out.  At one point I recall calling a very amused IBM tech support agent who kindly referred me to the manuals since they didn't support such an old system.

Yes, it literally came with all those books.

At some point, I managed to learn all about how computers work.  The physical components to me now were in that inventory and fascinated me.  I used this computer to try writing very simple AI programs in Basic (Chase the dot, dot warfare, etc) it worked well but I had trouble with implementation of some concepts.  I started taking formal programming classes in high school and learned all about modular, top down programming in my Pascal class.  I also learned simple graphical tricks and micro game making in Macintosh Hypercard.  I purchased the original "GCS" Game Creation System at this time.

A copy of the original advertisement for the 3D GCS.  
Make sure to click to full size and read for some giggles.

I was hooked on FPS's thanks to doom and the GCS.  I made some interesting stuff, messing with the forth/fortran backbone (who the fuck ever thought that was a good idea, is beyond me) to improve AI.

Somewhere in here I pissed off a programming teacher, switched schools 3 times, and eventually ended up at Dauphin County Vo-Tech school.  This school had a programming teacher who took me as his last great hope to sink the death star.  He taught me C, unix shellscripting, and a host of other things.  Got me a job in programming for the state, then later Keystone Programming.  Unfortunately massive pressure at home caused my life to crumble and I had to basically start anew.  The teacher, feeling crushed at my difficulties (as well as dealing with his own), retired the following year.

My biggest 'video game' programming achievement during this time period was writing the 'Coop-Bot' based on some code I found from the axe of friendship.  The coop-bot was an amazing AI piece built as a mod for quake 1.  No one at that time to my knowledge had written TRUE cooperative bots. Mine however had functional personalities and capabilities.  The code eventually was used by "Nelno" the Amoeba who wrote the reaper bot and moved on to write the Unreal Tournament bot code (based on the reaper bot code and by extension my own).  It was like fame by proxy.

My senior year in highschool was incredibly turbulent and somewhere in there, I had an english teacher nurture my writing abilities.  I wrote numerous short stories which ended up in the book I promote on the right (albeit many years later, after many MANY rewrites).  I however was stressed to my limit and despite my talents I was extremely limited by my circumstances.

Ok, a lot of background...

I spent the years after high school trying to start my own game development company and eventually got so soured by scumbag investors who wanted things like 60% stake for 40,000 dollars seed money (barely enough to get a programming firm off the ground, let alone finish a project).

We'd done a lot of free work, creating an impressive 3D terrain renderer and server architecture (me and my 6 or so buddies).  Eventually my experience was soured and I shut the whole project down spitefully.

A few years passed and Mechwarrior 4 came out.  I.. LOVE Mechwarrior.  Still do to this day.  So I decided to mod it.  I made a mod for the original game called 'Siege'.  This mod addressed many of the glaring problems in the game's multiplayer - namely a complete lack of single player functioning assets (turrets, repair bays, etc).   At some point I wrote the devs asking if they could increase the spawn points in the map to 32/32.  They asked me to send them my code and promptly ignored me.

A few weeks later, the rumored 'black knight' expansion came out featuring.. you guessed it... a special new deathmatch mode... called SIEGE!  Ironically nothing I could do at this point; they by right had the rights to all mod's intellectual property.  It did, however, REALLY sour my taste for game devving.  Throughout the years that followed I'd monkey with lite-c, opengl programming (thanks NeHe!)  and other components like the Allegro library.

But never again could I recapture the joy of just making a map, coding some scripts, and doing cool things... like back in high school.  Some 15 years later the spectre of Game Development reared it's head again and in my searches I discovered the FPS Creator Reloaded kickstarter.  I donated to it because at the time I was really impressed that they had a shader-driven engine that cost less than 800 to 3000 dollars.  The visuals were perfectly acceptable and by my standards would save me hundreds of hours in programming it myself.  Development comes along steadily and the system is easy enough to use.  Once the 'construction kit' is in play - I'll be running full tilt.

In the meantime, I'm learning LUA coding for the purposes of improving function in FPSC:R and making micro scripts to do simple tasks.  So far I've done some interesting screen effects and also written some custom AI modifications (shocker, right?).

Like these basic weather effects, for instance.

I hope, with time to produce not only interesting code snippets for what I find is an overwhelmingly helpful community (though considerably smaller than the Unity or Lite-C Communities) which might help pad my monthly art/development budget... which currently sits around twenty dollars per month.

Next time: The differences between writing a book and making a game.

What drove you to start making games?  What kind of experiences did you have?  I'd love to hear your comments and feedback!  If you'd like to support me please feel free to purchase a copy of my ebook:  The Longshores Rising

Monday, October 27, 2014

Teabone's TGC Store Products

Teabone was one of the first authors I bought from, when I first started aggregating content for this site.  I didn't spend much, his items were well priced.  However, this Canadian artist gave me several options of where to spend my pennies and I realized in comparing his products against others that a significant reason why I'm even writing this blog today was because of the choices I had to make back then when initially selecting what to get on a shoestring budget.

Teabone, a canadian, has apparently been working with or had an interest with FPSC for a long time, on the order of like eight years, if his forum profile is any clue.   He, like many other indy gamedevs has a number of interests strewn about.

His intermittently updated blog:  http://t-boneproductions.blogspot.ca/

And His TGC store:  http://en.tgcstore.net/?md=artist-view&aid=45855

Unfortunately there's not many items to review here.  Teabone has a very limited selection at this time and I must say that's a crying shame.  He's one of the better artists in the TGC community, at least in terms of his use of textures and color.  Every time I purchase I look at Teabone's store, hoping to find more to buy, but only finding the same eight or so products.  I truly hope more comes soon.

What is the one item I can't live without:  What is the one thing found in every dorm room, family dwelling, and office place?  It's so prolific yet we overlook it for less ubiquitous models.

Is that pizza bro?  Can I have a slice?

That's right, it's pizza.  A massive portion of the modern world's diet, this humble bread, cheese, sauce and toppings concoction has been vastly underrepresented in the gaming world.   Thankfully, Teabone has put a stop to it.  Now personally, I also own this:

Because this also fits in dorm rooms, family homes, and offices.

That's right.  Toilet paper.  Both of these items will cost you virtually nothing to own.   The art style meshes well with the likes of gencheff, nomis3d, HenryHam, etc.   I find that these items work so well I find myself using them in almost every single scene I do.


The bottom line:  It's top shelf art, at bargain basement prices.  Buy one.  Buy them both.  Buy everything he has.  You'll just find yourself wanting more.

Friday, October 24, 2014

Game Design Review - On Guns P2

This is a continuation of a topic in my Game Design Review series which began here:
http://fpscreloadedreview.blogspot.com/2014/10/game-design-review-on-guns-p1.html

When I think back to the original doom, and quake, I recall their weapons accuracy.  These games were fun and consistent, without all the tedious need for upgrades and add-ons just to make a gun shoot well out of the box.  It was an era of run and gun.  I really enjoyed the original Doom; it shaped all my gameplay experiences to come.

The guns back then behaved vastly more intuitively than they do today.  Oftentimes without any form of crosshair, to boot.

From this pretty awesome article: 


So let's talk terminology first.  It's a sticking point amongst many gun enthusiasts vs non-gun enthusiasts.  We see so many wrongly labelled examples it's quite maddening.  Why do we, as developers care?  People appreciate accuracy both in their weapons AND from the developers in terms of modelling game components.

Magazines vs Clips

Clips are, on the by and whole, not used anymore.  They are a relic of a bygone era save for mostly revolver clips.  A clip is a little metal piece that is used to hold bullets together.  It's flimsy and tiny, and generally is not what people are thinking of when they refer to a 'clip of bullets'.

Picture per wikipedia.

Note the distinct lack of a housing.  This defines a clip.  It's literally like a paper clip.  A simple metal piece that binds rounds together.

Some AK-47 Magazines per http://pokin-holes.blogspot.com

Not real hard to know the difference once you've seen it.  Also makes you look REALLY stupid to anyone who has even a passing interesting firearms if you're not making the distinction.

Shells, casings, and everything in between.

Similarly, the same applies to Shells.  Shells are effectively a whole, pre-fired bullet.  It includes the whole material components of the casing (usually brass or steel), the projectile (usually lead or copper), gunpowder, and a primer.

From hunter-ed.com


Often, however, people refer to empty shell casings as shells.  This is incorrect.  It's splitting hairs but do you really want to seem like an idiot to the more educated of your audience?

So, some simple education is in order on how bullets and guns ACTUALLY work.

In the beginning...

Humankind (arguably, at least in academic circles) proved his superiority both through his intellect but ALSO through his ability to throw objects which could kill his prey.  This effective 'arm reach' improvement gave a huge evolutionary advantage over similar predators.
(Source: http://phys.org/news/2013-06-chimps-humans-baseball-pitcher.html )

As time went on our methods of throwing things improved.  We used spears, spear throwers, slings (where bullets effectively originated), arrows and eventually firearms.

How firearms work.

Firearms are remarkably simple.   The bulk of the work is done by the bullet itself.  A firearm or gun is effectively a means to provide a loader, a way to initiate firing (trigger and firing pin), and a stabilizing platform (the barrel).

Obviously I got this from http://gunlink.info ^

PUT SIMPLY - IF YOU HAVE EVER USED A PEA SHOOTER, YOU KNOW HOW A GUN WORKS.  JUST SUBSTITUTE YOUR BREATH FOR A CHEMICAL REACTION WHICH CAUSES RAPIDLY EXPANDING GAS TO PUSH THE 'SPITBALL' (aka bullet).

On another note - once a gun fires and the casing is ejected.. there should be no more projectile in it!  I'm amazed how often people think it just shoots magic out the end and ejects a whole round.  Or alternately, that they think that it fires a whole projectile, casing and all.


IMPLEMENTING MORE EFFECTIVE GUNS IN FPSC:RELOADED

Now for the meat of this article.  Inside of the FPSC:R Engine folder (Typically C:\program files(x86)\the game creators\fpscr) there's a game core folder.  Inside of that folder is your weapons folder.  Within that are the individual weapons.

What we're looking for is the 'gunspec.txt' file.  This is gun specifications and effectively controls the behavior of the gun itself.

Within this file the main settings we are concerned with are:

'accuracy'   - The base hipfire accuracy of the gun.
'zoom accuracy' - The alt-fire 'down the sights' accuracy of the gun.
'force'  - Felt recoil.
'damage' - For tweaking your preferred damage settings.

The accuracy field is not as granular as you might think.  The game basically uses this value to define the cone of fire coming from the weapon.   The smaller the number, the smaller the cone.  Zero is no cone.

For the purposes of our example let's look at the values in the original shotgun gunspec file.

damage            = 15
damagetype     = 2
reloadqty         = 6
accuracy          = 8
shotgun           = 1

An accuracy of eight makes this gun seem like it's a blunderbuss. Heck, a blunderbuss was probably more accurate.  Damage is 15 per pellet.  In it's stock configuration the shotgun feels like one of the weakest weapons, often requiring 3-5 shots at a mere 3 yards to put away even the lowliest enemy.

This is my modified numbers:

damage         = 11
damagetype  = 2
reloadqty      = 6
accuracy       = 2
shotgun         = 1
range       = 1500

You might think this seems drastic.  Bear in mind, however, that the accuracy value basically acts like degrees of an arc.   I'm estimating but I'm fairly sure that it's approximately 5 degrees of arc per value of accuracy.  So a value of one gives a five degree cone, a value of two gives a ten degree cone, etc.  This value in testing gave me a nice tight spread.  This also seemed overwhelmingly powerful so I toned down the damage to bring it in line with it's value as a weapon.

I also added a range value, which wasn't present in the file by default.  This should (if not now, then later) make the weapon ineffective as a long range platform. An example of this was the quake (1) shotgun which could shoot the entire length of the map and retain a moderately realistic tight spread.  It made for an effective weapon at any distance, which was unreasonable.

Recommended changes for other weapons:
Colt 1911 - 35 damage, accuracy 1, zoomaccuracy 0, reloadqty 8 (up from 7).
Notes:  The 45 ACP bullet is a low penetration, moderate damage round.  It's on par with a 9mm in terms of ballistic performance.  Also, many modern 1911's carry 8 in the magazine, not 7.  Examples: the Wilson combat 1911, Sig Sauer's 1911, and even the Taurus PT1911.

357 magnum - 50 damage, accuracy 0, zoom accuracy 0, force 150.  
Notes:  The 357 magnum is a hell of a round.  It hits pretty hard for a pistol round and I wanted to
model accuracy as well.  The payback is of course in terms of recoil.

This was off a virtually stock el-cheapo Taurus PT1911 shooting generic ammo.


Ironically 45's are pretty damn accurate, but I *PREFER* using slightly different values to exacerbate the differences between the guns.  I also have a custom 1911-22 I put in (a 1911 using a .22LR barrel, magazines, etc) which has a fast fire rate, higher magazine count (12), less damage, and perfect accuracy with low recoil.  I needed slight value adjustments to make that work.  Until something more granular is available, these values will have to do.  I kept the default pistol ranges for now.  I want to play more with ranges before I make recommendations there.

Was this post helpful to you?  Please comment or message me if you have suggestions or criticisms!








Thursday, October 23, 2014

Dvader's TGC Store Products

Dvader is the renaissance man of the TGC community.  He's been around a long time and does just about everything from games, to levels, voice acting, coding, and all the way to 3d modelling.  It's impressive, to say the least.

Get his older DarkBasic Games here:  http://www.sentientsoftware.bandedsoftware.com/

Dvader's TGC Store:  http://en.tgcstore.net/?md=artist-view&aid=10622

While his shop is constantly being added to, he is the ONLY person I have seen who has a video walkthrough of his store:

Definitely some slick shit going on here.

Dvader unfortunately suffers from what a significant amount of jack of all trade types (I count myself in that lot) are afflicted by:  lack-of-mastery-itis.  He's got some really amazing products here but clearly his art (at least by my tastes) is not quite up to his coding level.   Some of the objects are remarkably well done though and definitely deserve a look or purchase.  Other objects with potentially less sophisticated art styles often come with their own unique script which is worth it's weight in terms of use and function in and of itself.  So there's definitely a lot of really great reasons to check out his store.

Dvader's use of color is a little brighter than I prefer but here again, your miles may vary.

One thing that is completely noteworthy is he probably has the best glass modelling in the game, bar none.

I can think of few AAA games that can match this level of quality for a simple glass.

His glass is better than every single other person's on the store, without question.

What is the one item I cannot live without: Here again I am forced to choose a split on my choices.  There are too many low priced, must have items to simply name one.

First, I really like this ashtray:

When you are making FO3 look bad, you're doing something right.

I find a good ashtray under-represented in most in respects gaming wise.  But on the TGC store I'm pretty sure this is the only one.  But look at it! We don't even need others.  It's literally THAT good.

In terms of packs, he only has one.  It's his 'clutter pack'.  It's well priced and has a significant amount of objects that really are completely unique.

It's reasonably cheaper at a 20% reduction over the already low price per item.

Now I'm just going to add that Dvader has one last thing that absolutely NEEDS mentioned.  His pick up and move script is amazing as hell, cheap, and necessary.  He's also got some free scripts worth grabbing but this pay one is incredible:




The bottom line: You may find his art not to your tastes but honestly there's too much here that's invaluable to pass up.  The pickup script is vital; the glass objects are beyond compare.  Decide for yourself and take a look!

If this post was helpful for you, please feel free to comment and share it with others.  I welcome all constructive criticism.  If you'd like your products reviewed, leave a comment below and a link to your game creators store.