Tuesday, March 24, 2009

Perfectionism

Wikipedia ...
Perfectionism, in psychology, is a belief that perfection can and should be attained. In its pathological form, perfectionism is a belief that work or output that is anything less than perfect is unacceptable. At such levels, this is considered an unhealthy belief, and psychologists typically refer to such individuals as maladaptive perfectionists.
Ok, i realize trying to make everything flow absolutely perfect is unhealthy and cannot really be achieved ... but i just can't help it. I mean it has to work right! The lives of villagers depend on it! Ok, not really ..  :p

Making good progress on getting the map to flow correctly though! What i've done is created 9 arrays that hold the basic map data. each of these arrays draws to a seperate canvas that is 2048x1024 ... i do this in order to speed processing. While i *could* try and make that canvas buffer larger that in itself would run into more problems, mainly having to go through map reloads. the 3x3 buffer allows me to reload and redraw areas off-screen and reduce the amount of time that the useri has to spend reloading data.

Also, the 3x3 array is dynamic ... meaning that the data as position 1,1 may not always be what's in the top, left corner. I simply have a pseudo-pointer (javascript doesn't do real pointers), that points to the current top-left of the drawing area. since the width and height of the array are fixed this allows me to draw the overflow sections by using 1st grade math ... p1+3 (right side), p1+1 (bottom), p1+4 (buttom right). Very simple!

The biggest trick is having to fit the pieces together smoothly. Because the minimap is click-able and draggable this changes a lot of the reference data. The good thing is that once i get this working, the same math applies to square tile-based layouts as it does to isometric tile based layouts.

And thus no code to show off today, perhaps soon though but again i only allow myself to work on this for a little while each week as bills come first. bleh!

Once i get this done, build some simple animation routines and get the basic collision working I will start making some mini-games in order to test the engine out properly. Not sure what i'm going to do first, i'm thinking perhaps a canvas-based tower defense game.

Friday, March 20, 2009

Guilds in RPG's

Not going to spend long on this today, too many things on the "honey-do" list not to mention sites that I need to get completed to keep food in our bellies. For starters in most mmo's their seem's to be a severe lack of real guild support for the players. Not to mention the fact that most of these mmo's are mearly about the grind and getting levels and seem to forget about other things.

Umm, idk why we can't get more female players ... i mean there's like 7 billion different monsters to kill! Ugh!...

That seems to be the general attitude that i've heard from admins and developers of games. Ok, well I guess i have the luxury of having a wife that likes to playe rpgs, well at least now she does. She very much doesn't like the grind and prefers to up her other crafting type skills and most monster-killing that she does do is related to that. Now i know that not all women prefer this type of thing ... which is really my point, no one strickly likes any one thing. But I digress I do seem to be getting slightly off topic.

The whole point being in order to even make these expansions of what guild can do, you also have to expand the content available to them. The only real problem with any of this is the fact that it expands the possibility of cheaters and scammers, but the only real way to deal with that is with the help and support of your player base.

In addition to guild and town buildings/housing their should be ways to organize this ... for both the players and the guild owners. Here is a breakdown of my ideas ...


MMORPG Guild Structures ...

  • Nation -> County -> Town

    To form a Nation you have to have at least 2 Counties.

    To form a County you have to have at least 2 Towns

  • Society -> Faction -> Circle

    Societies are secret clans, they may not form cities (that would defeat the "secret" part).
    Members of a circle cannot see members of other circles, only the officers and leaders can see this amount of structure.

    A society themselves may be public and have an office so that they may give off a certain appearence. The factions and circles however, and their intentions,  always remain secret. For example your Women's Society has a faction named the Black Widow's that is dedicated to only killing male players.

  • Clan -> Guild -> Squad

    "Guild" is the starting point, they may break their members into squads if they wish. Multipul guilds can form a clan. You can be a Member of multipul guilds (i.e.: Your a member of Knights of Ni and the Gardening guild.)

    Guilds are usually based in towns that they help to support, but they are not required (obviously unless the town you build your 'base' in requires your help).

    Guilds can build bases in multipul towns ... for example Your Guild, The Brotherhood of Bronze has their main office built in Noviscus but a minor recruitment type office in nearly every other major town.

All of the above should be able to share resources, though societies this is obviously limited due to their nature. All of these resources though take up space so you have to have a place to put these donations.

This is definatly the early stages of this idea and up for change. But i think you see the basic idea that I am getting too ... more possibilities for players and stop trying to limit them. They do all of this anyways!!! If you impose a limit of 15 players per guild, all they do is make multipul guilds. Impliment it into the game, keep their possibilities open and just let them have fun with it.

Wednesday, March 18, 2009

Expansion on Housing

Ok, going to expand on my ideas for player owned housing. The idea of the players being able to build and modify the existing landscape will be one of the core elements on the actual javascript engine. This, like all other items beyond basic drawing routines will be built as a module so it can be added too and/or modified easily.

In the other game I am developing, Nemesis Star (a space-based MMOR), actual habitable planets are somewhat rare so the players have the option of construction massive space stations. In addition to this they will be able to rent sections of their newly constructed station out. As such it makes sense to me, since i have this similar idea in multiple games, that it should be built into the core engine. Not to mention the fact that a great portion of online players really like the idea of having their own little piece of the world that they own.

I have played way too many mmorpg's in my life, quite a few of them in their early release and beta stages. A great many of them totally flop on their ideas for housing, perhaps due to a lack of understanding of the wants and needs of their player base? Or problems due to lack of available land, or allowing them to build houses pretty much anywhere. I remember one 3D FPS types mmorpg that some friends and I played, we put our house on top of a gigantic tree. 

Anyways I'm rambeling a bit here so here's  an expansion of the list of core ideas that should be addressed.

  • Guild Housing.

    Almost all players join a guild and as such they should be allowed special housing just for them! Any housing built for the guild is owned by the guild itself, not any one player. This is to prevent characters who go inactive but control the resources of the guild.

  • Hiring Workers.

    Not all players will want to spend the time leveling up construction and building skills just to add a single room to their house. You should be able to hire other players to build your house for you! Not only does this encourage a few to work these skills, but it opens up a whole new market for the players beyond just crafting a billion arrows to sell.

  • Hiring NPC's.

    In order to get people from spamming the town square with their goods they are wanting to sell you will have the ability to hire a merchant to sell them for you. This obviously is not a new idea for any of those who have played Ultima Online. In addition you can hire protection for your house, expecially seeing how you can be attacked by "monsters".

  • Traps and Magical devices.

    Certain sensitive rooms you may wish to put traps on if you are part of a PvP town. Their will of course be areas that you can store your hard-earned items but anything stored your house withing this type of town is up for grabs by an expert thief. You may have to feed and pay an NPC guard untill the day they die, but an Iron Golem never sleeps and doesn't care for gold.

  • To Catch A Thief ...

    In order to prevent a massive uprising of theives their has to be a way for players to bring them to justic. And as such your traps and NPC guards always have a chance to capture the player roaming around your home. This can lead to prison time or even public hangings, it is entirely up to the town. I'm sure their will have to be quite a bit of tweaking work in order to get it to run smoothly, but it is an idea that has been mentioned repeatedly across many different mmorpg's but has never been taken seriously. 

  • Environmental Changes ...

    Due to the fact that the map is saved on the server and delivered dynamicly you will be able to make some changes to the map itself. Things such as planting trees, cutting trees down that are in your way, leveling the ground out and more. Say for example your land area borders a mountain / cliff area. You do have the option to begin a tunnel and continue your town inside of the mountain. The downside, to that is if your town get's taken over by mob's, they also take over your new dunegon.

  • Unbuildable Areas ...

    Their are none, but some areas may require a great deal more work to ... pacify .. than others. Not to mention if you just start throwing up a house just anywhere you may find the kings guards on your doorstep demanding their taxes and other fees. Or perhaps you build your house within a PvP town's area without their permission ... they now have the right to take the taxes out of your hide.

  • Underwater Cities ...

    Yes, when i said you should be able to build anywhere ... with the right technology and skills ... you can build anywhere!


That about sums up the core ideas I have for housing, next i will touch on player guilds, factions, towns, nations.

-M

Tuesday, March 17, 2009

Goal for Lychgate

Nothing to report yet on my new logo page, having some problems still with the icons hopping around like little bunny rabbits. Pretty sure I know how to remedy it, just have to make the time to do it. But as always paying jobs come before any hobby work!!

Anyways, my primary goal for lychgate is PvE, not PvP. Almost all games that i've played concentrate more on PvP than anything else (except for graphics). Me, i'd rather have more of a real story-line and some real character buildup / skill base.

For example, one of the things that really made Ultima Online was the fact that it had a large skill-base and PoH (Player Owned Housing). Their biggest problem was also PoH ... the world seems quite large untill you figure in a hundred thousand players all trying to build their new houses on top of each other. 

My ideas for remedying this? ...

  • Super large maps / play area.

    The Biggest problem with this idea, beyond the obvious server-storage issues, is movement time. This is easy to remedy though by allowing a more intriquite teleport and gateing system. Also allowing players to build transportation networks (roads, ships, ect.) to increase travel speed.

  • Housing Decay.

    Yes, in real life if you don't properly maintain your house it will fall right on top of your head! Players who are inactive or just never visit their house will find that have decayed. While they will not dissapear entirely for quite some time, other players can take over the property and fix it up!

  • Housing Prices.

    Prices for player housing in most of these games are way too cheap. Plus if you are within the bounderies of a kingdom you will have taxes to pay if the current king (emporer, mayor, whatever) deems it so. To offset these prices a rental system should be put in place as well. 

  • PvE (Player vs Environment)

    Built your house right on top of a goblin village? You may find the goblins attacking your new house then! If you build a house / town / anything, you will have to defend it, this is not a human-friendly environment untill you make it so.

  • PvP (Player vs Player)

    If you are part of a town that participates in PvP then your house and town can be attacked by other players as well as "monsters".

  • Dynamic Construction

    You are not limited to a prefabricated anything. Build up your house one room at a time or all at once. Don't forget to put a roof on it if you have wood floors though as that will increase the decay rate of your home. When you purchase rights to build within a kingdom, you actualy purchase a piece of land to build on, so if you wish you can build a stone wall around your entire lot.

That's it for now, have to head out for the day!

-M

Friday, March 13, 2009

Worked some on my new logo page again, i added an icon to one of the spikes then discovered just how bad they were hopping around in the wrong places. Tried to correct it by just modifying the starting angle by which it was being drawn but no dice there, made the problem worse. hehe. Finally figured by doing a little bit of flipping around in the object arrays it workes just fine. Next up on the list will be to add more interactivity than simple cheesy mouse-overs. I added color to the object so i could track the spikes location easily, but will leave it in there. Will also add in border-color to the next version to show what is currently highlighted. A lot of what i'm working on with this simple logo will will be applied to the canvas engine, especialy the mouse-detection within a triangle portion. 

http://www.nemesisstar.com/sb_index_nemi3.html

Trying to slow down how much i was playing Atlantica ... way too addictive! Had a few friends of mine play it and I have barely seen them online since ... lol. Pretty much confirms to me that your game doesn't have to be exactly like 'WoW' in order to be popular. I already knew this but it is always nice to have real confrimation.

Ok, going to work on this some more but i doubt i have more to post quickly. If you want to look at the source code just go to the link above and view-source.

-M.

Wednesday, March 11, 2009

ASP IP Ban/deny list from .htaccess file.

:::General Information :::

Granted I did not search for very long for for those familiar with microsoft servers know that trying to use an .htaccess file with IIS just doesn't work. If you have direct access to the server then you can follow microsofts directions on how to do it, but alas not everyone can do that. So I decided to write a little include script to  correct this issue.

So far the only thing in the .htaccess file that it pays attention too is 'deny from' and 'allow from', and it will work across an ip range ... example:   192.168.1.1/100

Just rename the .htaccess file that you want to use to htaccess.txt, save this script into a file that you can include in your asp pages. Very simple. If are not a developer and want this on your site then please visit my site and I will get it up their for you. If you are a developer than feel free to use this script! You cannot charge for the script itself though, or include this script in a larger package that you charge for without my express permission.

If there's something relating to .htaccess files that you want added to this script then please let me know and I will update it and repost it here. 

If your looking for a list of ip addresses then visithttp://www.wizcrafts.net/htaccess-blocklists.html they have .htaccess files for several known spamming and scamming places, including ip's for several web-proxies to preven them from back-dooring into your site.


:::EDITS & UPDATES :::

none yet requested.


::: SOURCE CODE ::: 11MAR2009

Dim FSO, FO, File, numitems, htfile, line, ips, ip, ip4, userIP, accessallowed, overrideaccess

accessallowed = true
overrideaccess = false
userIP = Request.ServerVariables("REMOTE_ADDR") 
htfile   = "htaccess.txt"

Set Fso  = Server.CreateObject ("Scripting.FileSystemObject")
Set Fo   = FSO.GetFile(Server.MapPath("\" & htfile))
set File = FSO.OpenTextFile(Server.MapPath("\" & htfile),1,true)

' Pre-check for ALLOWed IP's. ...
Do While Not File.AtEndOfStream
  line = File.readline                                  ' Open the file for reading
  line = LTrim(LTrim(line))                             ' Trim any excess space from edges
  if LCase(left(line,10)) = "allow from" then           ' IP Deny list, process this line
    if line <> "all" then                               ' We won't be using the "all" keyword
      procDeny = LTrim(RTrim(Mid(left(line,10), 10)))   ' Trims out the ip list itself.
      ips = Split(line, " ")                            ' List is usually seperated with a space, this is used as the delimiter
      for n = 0 to UBound(ips)                          ' Loop through all the possible IP's.
        ip = Split(ips(n), ".")                         ' Split IP string into an array
        if UBound(ip) = 3 then                          ' Got an ip address and not a command. (should start at #2 normally but never assume!)
          ip4 = split(ip(3), "/")                       ' Try to Split 4th IP address string into an array
          if UBound(ip4) = 1 then                       ' Lower and upper bound of the IP address. otherwise it is just an ip address!
            for m = ip4(0) to ip4(1)                    ' Loop through all the IP's in this range and check them.
              if ip(0)&"."&ip(1)&"."&ip(2)&"."&m = userIP then
                overrideaccess = true                   ' Known good user, over ride the deny-checker and let them in
              end if
            next
          else
              if join(ip, ".") = userIP then            ' Single ip address, not a group, check it.
                overrideaccess = true                   ' Known good user, over ride the deny-checker and let them in
              end if
          end if
        end if
      next
    end if
  end if
Loop



' we do a simple close and reopen of the file as to increase server compatibility
File.close()

Set File = FSO.OpenTextFile(Server.MapPath("\" & htfile),1,true)
if overrideaccess = false then
  Do While Not File.AtEndOfStream
    line = File.readline                                  ' Open the file for reading
    line = LTrim(LTrim(line))                             ' Trim any excess space from edges
    if LCase(left(line,9)) = "deny from" then             ' IP Deny list, process this line
      if line <> "all" then                               ' We won't be using the "all" keyword
        procDeny = LTrim(RTrim(Mid(left(line,9), 10)))    ' Trims out the ip list itself.
        ips = Split(line, " ")                            ' List is usually seperated with a space, this is used as the delimiter
        for n = 0 to UBound(ips)                          ' Loop through all the possible IP's.
          ip = Split(ips(n), ".")                         ' Split IP string into an array
          if UBound(ip) = 3 then                          ' Got an ip address and not a command. (should start at #2 normally but never assume!)
            ip4 = split(ip(3), "/")                       ' Try to Split 4th IP address string into an array
            if UBound(ip4) = 1 then                       ' Lower and upper bound of the IP address. otherwise it is just an ip address!
              for m = ip4(0) to ip4(1)                    ' Loop through all the IP's in this range and check them.
                if ip(0)&"."&ip(1)&"."&ip(2)&"."&m = userIP then
                  accessallowed = false                   ' Known bad user, deny them access.
                end if
              next
            else
                if join(ip, ".") = userIP then            ' Single ip address, not a group, check it.
                  accessallowed = false                   ' Known bad user, deny them access.
                end if
            end if
          end if
        next
      end if
    end if
  Loop
end if
File.close()

Set FO = nothing
Set FSO = nothing
Set File = nothing

if accessallowed = false then
  Response.Redirect "/no_access.asp"
end if

Friday, March 6, 2009

New javascript/canvas splash page

Still working on my new splash page, i'm just not happy untill it works 100% like i want it too. You can view version two here: http://www.nemesisstar.com/sb_index_nemi2.html the first version is still in the same place, just go the the other blog entry to look at it and the code walkthrough.

Not going to go through all of this, basicly i had to get the 3 points of the triangle(s) and run them through a barycentric calculation.  If you want an explination on how that math works then visit these two sites ...


Now here's the main piece of code that has been added ...

        if ((((mouseX-ckW)x)) && (((mouseY-ckW)y)))
        {
          // Calculate the points.
          px1 =  x;
          py1 =  0;
          px2 = ((spikes[i].width * angCos[mmAng]) - (38 * angSin[mmAng]))+x;
          py2 = ((38 * angCos[mmAng]) + (spikes[i].width * angSin[mmAng]));
          px3 = ((0 * angCos[mmAng]) - (77 * angSin[mmAng]))+x;
          py3 = ((77 * angCos[mmAng]) + (0 * angSin[mmAng]));
          
          // Y-Axis Scale modification
          py1 = ((py1+y)*(scaleY))+ ctxHeight*((1-scaleY)/2);
          py2 = ((py2+y)*(scaleY))+ ctxHeight*((1-scaleY)/2);
          py3 = ((py3+y)*(scaleY))+ ctxHeight*((1-scaleY)/2);
          
          // barycentric calculation
          b0 =  (px2 - px1) * (py3 - py1) - (px3 - px1) * (py2 - py1);
          b1 = ((px2 - mouseX) * (py3 - mouseY) - (px3 - mouseX) * (py2 - mouseY)) / b0;
          b2 = ((px3 - mouseX) * (py1 - mouseY) - (px1 - mouseX) * (py3 - mouseY)) / b0;
          b3 = ((px1 - mouseX) * (py2 - mouseY) - (px2 - mouseX) * (py1 - mouseY)) / b0;
          
          if (b1>0 && b2>0 && b3>0) {
           spikes[i].mouseover = true;
           } else {
           spikes[i].mouseover = false;
           }
          
        } else {
          spikes[i].mouseover = false;
        }

Not going to walk you through every line of code there but basicly it it calculated the rotation of the 3 points (without the Y axis modification). Then it adds in and scales the points according to the current scaleY. After that it simply runs through the barycentric calculation formulas and does a simple check.


If you read the last blog entry you should also notice that it doesn't draw the spikes from an image any longer, now javascript renders them to the canvas through a simple object prototype called 'Spikes' ...

    function Spikes()
    {
      this.x = 0;
      this.y = 0;
      this.rad = 0.0;
      this.width = 105;
      this.ctx = '';
      this.mouseover = false;
      this.draw = function()
      {
        this.ctx.save();
        this.ctx.strokeStyle = "rgba(255,0,0,0.5)";
        this.ctx.lineWidth = 1;
        this.ctx.translate(x,y);
        this.ctx.rotate(rad);
        this.ctx.beginPath();
        this.ctx.moveTo(0,0);
        this.ctx.bezierCurveTo(0, 15,  85, 23, this.width,  38)
        this.ctx.bezierCurveTo(85, 53, 0, 62, 0,  77)
        this.ctx.bezierCurveTo( 5, 67, 5, 10, 0,  0)
        if (this.mouseover) this.ctx.fillStyle = "rgba(255,0,0,0.5)";
        this.ctx.fill();
        this.ctx.restore();
      };
    }
    spikes = new Array();
    for (i = 0; i<=8; i++) { spikes[i] = new Spikes(); }
 

yes, draw is a function not a string ... remember EVAL is EVIL, we don't use it. If you haven't used javascript prototypes before then you definatly will have to read up on them as i progress through this, or if you want to mess with anything in the google api.

Ok, i need a break and am going to go blow something up.



Thursday, March 5, 2009

AI Game Theory

Still waking up, and very unfortunately I am sipping tea instead of coffee. The wife insists that it's better for me. I'm not sure about all that ... :-)

My thoughts on how I want the default AI to work in my lychgate engine:

  1. Multiple levels of AI intelligence. Deer, and rabbits will not react as well as goblins, who will not react as well as dragons. I don't believe this should go by the default rule and just make them much stronger just to simulate this. Not going to do any JavaScript neural net programming ... i think that would possible be overkill. Instead the more creatures with more intelligence should have their own databases for battles with the characters marking successful and unsuccessful attack methods. Very simple, not real complicated programming and it has been proven to work in games such as computer chess.
  2. Animal Intelligence. Be default animals fear sentient creatures that attack them so as such herbivore and omnivore animals should by default make an attempt to run away. This will be a bit more difficult due to the battle style that I have chosen to go with but I'm sure with some trial and error in the alpha tests we can get this to work very well. Carnivores though, especially pack animals, may decide that attacking is their best choice so should run the simplest version of rule #1.
  3. Sub-Human. Goblins, and other related creatures will be classified as sub-human, and use the second simplest version of rule #1. They will though always travel in packs but may not always rush to help their friends due to their higher fear factor.
  4. Human. While it will never be close to real human intelligence, but through building it's own database of battle techniques to use against varying foes I believe we can simulate it very well. These and the other more intelligent foes always give more experience as well. The game should not be about the grind, every other game concentrates on that, i'm looking for more social interaction and group activities not just "hey, i killed 10,500 orcs and completed my noobie quest!"
  5. Above-Human. Better usage of the database, goal will be to be the big-blue of rpg battles. Yes, i have this problem where i dream to big. :p But if your going to dream that's the only way to do it.
  6. God-Like. Not only will it try to always choose the best usage of the database, they can influence all other creatures and can randomly be taken-over by the Admins! The rest of the god-like creatures will remain a secret ... for now.
Creatures will also war against other creatures ... they are not all friendly and cozy together. Also because of this creatures, sub-human and above, can gain simple experience levels. Nothing nearly as complicated as actual players (too much data to keep track of) but just and additional 2-3 bits of information. Also they will have the ability to change out their weapons and armor ... the biggest reason for this is the god-like creatures and humans who wish to be 'evil'.

Ok, that's enough ranting, some or all of these ideas may change depending on how will they work in actual implimentation ... but it's just me making this game at the moment and as such i'm the only one to bounce ideas off myself. :p

Wednesday, March 4, 2009

Busy Busy Busy

Ugh, barely any time to breath let alone work on lychgate. Been driving around Raleigh for what seems like an eternity now dropping of resumes and shaking hands. Most calls though have been from recruiters, which isn't that bad but they'll pretty much call anyone. Finally though the efforts are paying off and getting some real interviews.

I've never had any luck with any of these job-posting sites though, only people who call me from them is the recruiters. Yes I'm still very much a geek and believe more and more things will migrate to the internet. But even in all it's glory it still can't beat the personal touch of actually meeting someone face-to-face when handing them a resume and shaking their hand.

Perhaps if my job interview this afternoon goes well then I'll be able to have more time to concentrate on my game engine. Otherwise my wife and I will end up homeless soon. Neither of us have any family close by, but one of our friends in an online game we play invited us to stay with them if we do get our butts kicked out the door.

Been playing a Korean made game called Atlantica though for some stress relief. It's pretty fun, reminds me of final fantasy a bit. The battles are somewhat more tactical than most mmo's I've played, but their pay is based off selling items and then calling it free. Which it is free, no real limitations and you don't have to buy anything. But you can also get to level 95+ in a couple weeks if you don't have a life at all. Seemed like it was a great concept but they got side tracked along the way.

Well got to get to work, will post my interview results tomorrow and spell check this later.


-edit: spelling must be getting better, only FF only spotted one real error. :-)