Version 0.3.0

From VbGORE Visual Basic Online RPG Engine

Contents


[edit] Downloads

All downloads contain the same files, just using different compression methods.

Non-EXE users must download the Libraries Files at the bottom!

*.EXE - Self-installing file (11.83 MB)

*.ZIP - Compressed with WinZip (12.51 MB)

*.RAR - Compressed with WinRAR (10.39 MB)

*.7z - Compressed with 7Zip (10.43 MB)

Libraries Files (Not required for EXE users) (1.08 MB)

[edit] Release Notes

Released on February 3, 2007

This is by far the biggest, greatest release of vbGORE ever. Theres so many changes, I don't even know where to begin. The map system was rewritten to unload unused maps and NPCs on those maps from memory, saving tons of RAM and cpu usage. The server updating loop was changed to be much faster, CPU-usage conservative and efficient. Chat bubbles were added and automatically size to fit the text. All the server code was cleaned up. Tons of playability issues were fixed (/quit working all the time, dragging items between many windows, etc). NPC names that are needed are stored in memory to prevent excessive database accessing. NPCs and maps are saved in temp files to make loading of maps take about 1ms, while loading NPCs takes less then 0.1ms. Simply put, the engine is just a hell of a lot better!

[edit] Change Log

Fix - Amount window values: Fixed the amount window to not crash when entering in an invalid value, and will not allow you to enter a value larger then the maximum value for an integer.

Fix - Selling distance: Fixed the selling to NPCs to check the distance between the user and NPC before selling.

Fix - NPC ranged attacks: Fixed NPC ranged attacks to check for a valid path instead of just attacking. Thanks, Zapato!

Fix - No trading after moving: Every time you move or warp, the TradeWithNPC flag is cleared. Thanks, Onez0r!

Change - Bank window closing on move: Changed the bank window to close when you move instead of staying open.

Add - NPCName array: Added an array on the server that stores NPC names so the database doesn't have to be contacted for the name of a NPC for quests. Only NPCs used in quests get their names set, and the array is only sized to the highest index used for the quest NPCs, so minimal amount of ram is used.

Add - Chat bubbles: Added chat bubbles that will appear over characters when they talk.

Change - NPC.temp: Changed the .temp NPC loading to work even faster then before, making their loading time faster then you could ever need.

Add - Flashing text cursor: Added a flashing cursor to selected text boxes so you can see what box text will be entered into.

Add - Valid char checks: Added valid character checks on some of the text input boxes.

Change - Engine_WordWrap: Changed the Engine_WordWrap to work off of exact text sizes instead of number of characters for pixel-perfect line breaks.

Remove - RequestMailInfo: Removed the RequestMailInfo packet, and made the mail description handling purely client-side (all the values are passed when the objects are passed). The old setup was just poorly done.

Add - NPC .temp files: Added .temp files for NPCs that work like the map .temp files. The advantages of it are that MySQL is only accessed, for NPCs, at server runtime, and from there on is loaded from files. Also, it is about 25x then the old method when compiled.

Add - ServerTempPath: Added the ServerTempPath for temp server files instead of writting them into currently existing folders.

Change - Potion graphic: Changed the potion from a red dot to an actual potion.

Fix - Invalid MP with MakeChar: Fixed a typo on the client that had the MP percent setting to the same as the HP percent. It was only noticeable when a character was created.

Fix - NPC ActionDelay and SpellExhaust: Fixed the ActionDelay and SpellExhaust values for the NPCs to check if > CurrentTime instead of > 0 and so on.

Change - ActionDelay to Counters: Moved the NPC's ActionDelay variable from Flags to Counters, where it fits more appropriately.

Remove - Server compression: Removed the compression module from the server since theres nothing the server would need to compress / decompress.

Change - Encryptions module split: Split up the encryptions module to Encryptions and EncryptionsEX since most of the time, you won't ever need to use anything but XOR or RC4 (because the rest is so slow and bulky) so theres no need to store them all in memory.

Fix - General server code: Went through for a few hours fixing up the server code with CodeFixer, fixing random things everywhere.

Fix - Client closing: Fixed the client closing when typing /quit.

Fix - Crashing on NPC unloading: Fixed a problem that would crash the server when unload all the NPCs by trying to redim the NPCList array from "1 to 0".

Add - NPC_CleanArray: Added the NPC_CleanArray, which was part of the NPC_Close array, but moved out so it could be called manually. By default, NPC_Close will call it if the NPCIndex = LastNPCIndex, but for the map unloading routine, since multiple NPCs can be cleared (and can resize the array many times, which would be excessive CPU usage) is just checks once at the end of the unloading.

Fix - Unload_Map: Fixed the Unload_Map to use NPC_Close instead of just clearing the NPC's values. This allows some ram for the NPCList to be freed up, along with correctly sets the LastNPC value.

Fix - NPC_Close: Fixed the NPC_Close routine to clear out the NPC's values from the CharList, too.

Add - Tons o' dragging: Added dragging for the following routines: Inventory -> Bank, Inventory -> Shop, Inventory -> Mail, Shop -> Inventory and Bank -> Inventory. Bank -> Inventory will auto-withdraw 1 if there is only one. Both the Bank and Shop -> Inventory allow you to take in bulk with the amount window.

Add - Server sleep time check: Added a routine to check how long the server sleeps to make sure it never sleeps longer then the max time just in case something screwy happens and the timing gets off.

Add - AmountWindowUsage: Added AmountWindowUsage which replaced the AmountWindowWindowValue. The AmountWindowUsage uses unique constants that define the action the amount window is doing, so that way the amount window can recognize the difference between "Bank to Inventory" and "Inventory to Bank".

Change - timeGetTime to GetSystemTimeAsFileTime: Changed the timing method from timeGetTime to GetSystemTimeAsFileTime, which is a bit more accurate, but more importantly, holds much larger numbers. Unlike timeGetTime, which "rolls over" after 25 days (since the value hits the end of the Long variable limit) of your computer being on, this function won't roll over for over a thousand years. Only downside, though, is that it requires all counters to be changed to the Currency variable instead of Longs, which takes up twice as much memory, but it is worth it. Thanks, Verrigan, for the idea!

Add - DragSourceWindow: Added the DragSourceWindow variable that states what window a dragged item came from, instead of assuming everything was dragged from the inventory.

Fix - Connecting difficulties: Fixed a problem that seemed to not make the client want to connect to the server easily.

Add - Bank distance validation check: Added distance validation checks to the banking routines so users can't hack the server to grab/store items from anywhere they want with the correct hacks.

Add - Distance check to tile clicking: Added a distance validation check to the tile clicking routine (User_LookAtTile).

Change - Server game loop: Moved the whole loop from a timer to a Do / Loop loop using the Sleep API to bring the load off the CPU as needed. In the process of converting it, a lot of little fixes were made. Combined with that, each individual part of the update loop got it's own timer so you can keep track of how often things are updated. For example, the user's buffer is checked every (by default) 50ms, but the counters are only checked every 200ms and the stats (to update client-side) every 600ms. This makes spreading it much easier to update important things often, while the not so important things, like the map updating, take their time.

Remove - Server elapsed variable: Removed the elapsed variable from the server since it was no longer needed with the new timing system in play.

Fix - NPC warcursing: Fixed a little problem with the NPC warcurse routine that basically made the warcurse never update.

Fix - NPC AI updating overhead: Removed some needless duplicate overhead from the NPC AI updating routine.

Fix - Exit subs in the user updating: Fixed some accidental exit subs (not sure what I was thinking when I put them...) in the update routine's user updating.

Change - Counters timing system: Changed the timing system of the counters (lets use spells for this example) to be based on Elapsed + Spell Time instead of SpellTime and using - Elapsed. This is less variable manipulating, along with doesn't rely on elapsed, which can't always be the time we are looking for along with ends up being inaccurate over time (since it is rounded to the nearest millisecond). This method will be as accurate as possible (accuracy depends on how often the check is called).

Add - User face attacking direction (melee): Made the user rotate to face who they attack if attacking melee to go with the fix below.

Fix - Heading syncing errors: Fixed the heading on the server and client not being the same (usually happened when the user's position got reset to another position) by having the client send the heading in which they attack. This way the user will always see who they are attacking correctly instead of hoping it is the same on the client as it is on the server.

Add - User_RequestUserCharIndex: Added a packet that the client can send to the server to retrieve their char index in case something gets messed up and the client, for some reason, doesn't have the right character index. Every now and then, the index would get off when switching maps for a second and crash the client. This should prevent that from happening any more.

Add - Banking depot: Added a depot for banking where you can put your items. All it takes is making a NPC with the banker AI (default 6) and right-clicking them.

Fix - Crashing on receiving text too quick: Fixed crashes that happen when the text was received before the engine could finish loading. Solved it by moving the GUI loading into sub Main, instead of waiting until then engine initialized.

Fix - Window click object client pre-checking: Added checks to the window clicking events for the shop and bank windows to check that the object exists before sending the packet to the server.

Add - Amount window parent window: Added a variable, "AmountWindowWindowValue", which is the parent window value (such as ShopWindow) that created the amount window. This replaces the old method, of just checking by what windows are open and guessing.

Fix - Amount mail item sending: Fixed the mail sending to send items that have an amount of more then 1 by using the Amount window.

Add - UpdateInv flag to User_RemoveInvItem: Added the optional UpdateInv flag that you can set to 0 (default is 1) to prevent sending the inventory slot update packet. Sometimes there are a few things that need to be done before the slot update is ready to be sent (such as if the object is being removed after unequipped).

Add - Banking NPC / AI: Added a banker NPC that uses a new banking AI. The AI in the NPC_AI routine doesn't do anything, but when clicked, if it is a banker AI, it will open the banking depot.

Fix - Emoticons while typing in amount window: Fixed emoticons from showing when entering values in the amount window.

Fix - Enter text buffer cropping: Fixed the enter text buffer to automatically crop down the entered text to fit by the size of the text entered. Whenever the buffer changes, it loops backwards through the text to find the maximum size that it can show.

Fix - Chat text buffer line-up: Fixed the chat text buffer to line up properly instead of having an accedental indent at each line break.

Add - Text buffer vbCrLf support: Added support to the text buffer to break at vbCrLfs. Whether you pass any or not, it will handle it just the same. Lines will still break if they get too long, too.

Change - Engine_AddToChatTextBuffer: Changed the Engine_AddToChatTextBuffer routine to support splitting font on a per-pixel basis instead of per-characters. This allows for pixel-perfect detection of when the limit has been reached in the buffer. The routine allows a maximum of 8 characters back (by default) to be split onto the next line if it contains a space - the rest are split just by the last character. In other words, any word longer then 8 characters "can" be split if it hits the end of the line. Much more accurate, and much better looking then the old routine.

Change - Font init split: Split up the Engine_Init_Font so that the textures for the font can be loaded after the d3d device is loaded, but the font information can be loaded at runtime so information passed to the AddToChatTextBuffer before the engine finishes loading (such as the message of the day packets) can have the font size information to work with to allow for by-pixel font splitting instead of by-character.

Fix - Map editor tile preview value changing: Fixed the map editor's tile preview screen so that when you edit values that are editable, it will make the appropriate changes on the map tile.

Add - Signs: Added support for signs. The best of all, the signs are completely, 100% client-side. The only time the server even looks at the sign is when the initial map is loaded to create the .temp map, and that is just at runtime. Its not even loaded into memory or use any bandwidth on the server.

Fix - On Error Resume Nexts: Added the On Error Goto 0 on two On Error Resume Nexts in the AllFilesInFolder module that were left out. This prevents the On Error Resume Next for being carried through to other subs.

Fix - Texture/sound buffer unloading timers: Fixed the timers variables to be longs instead of integers so larger values, more reasonable values are supported.

Remove - Ground object loading/saving: Removed the loading and saving of ground objects, since it just does not make sense to load and save ground objects with the way the engine is set up.

Fix - Map editor value backspace: Fixed a lot of the map editor value input boxes to accept backspaces.

Fix - Map editor light value entering: Fixed the map editor to allow you to enter "-" and backspace in the light value fields.

Fix - Map editor light preview value: Fixed the map editor to show the correct light value in the tile preview list.

Add - Sign flag: Added a sign flag to the map editor, along with to the file loading and saving for the map editor, client and server.

Fix - Map sfx info: Fixed the map tile information on the map editor to show the correct sfx value for the tile.

Add - Map erase timer: Added a timer to the map erasing so maps don't have to be unloaded right when the last player leaves it. It was added to the map object removal loop, so the accuracy of the unloading is limited to the accuracy of that loop (default 30 seconds), but that should be no problem since it saves a bit of extra processing in the long run.

Add - Skins list: Added support for typing just /skin displaying a list of the skins instead of the skin does not exist message.

Add - New skins: Added a bunch of new skins to play with.

Add - Skin partial-name support: Added support for partial names on the skins, so the closest match will be selected. For example, /skin c will load classic, unless you have another skin that starts with c that comes before classic.

Remove - DevMode from skins: Removed the devmode settings from the skins since it was unneeded.

Add - Map loaded flag: Added a flag that states if a map is loaded or not. That way, you can't accedently load an already loaded map, or unload an already unloaded one.

Add - Selling to NPCs: Added user selling to NPCs. By default, each item is sold for half the cost of the value.

Add - GrhRaw compiling message: Added a message at the top of GrhRaw.txt telling people they need to run GrhDatMaker after changing the file since a lot of people seem to miss that.

Fix - Ghost NPC bug: Fixed a bug in the map loading that would create "ghost" NPCs in the server that you couldn't see, but you could attack and they would act as road blocks.

Add - UseOnce object UseGrh support: Added support for the Use Grh on the Use Once objects so objects like potions, fireworks, or whatever can have effects when used. For a demonstration, a spinning star was added.

Add - Server_MakeEffect packet: Added a packet that the server can use to make generic effects on the effect layer.

Add - Char request packet: Added a packet that will request information on a character from the server. If the client gets a packet from the server on a character doing an event but they do not have the character, it will send a request to the server so that character will be made. This way, if an NPC fails to be made for whatever reason, it will be created the next time the client gets a packet on an event involving their index.

Change - Map loading system: Changed the map loading system to, instead of loading chunks at a time and using CopyMemory to put it into the map array, it loads directly into the map array all at once. No buffers, no multiple get calls, just one giant loading right into the map UDT. It required moving the objects out of the map UDT and into their own UDT (that is sized by the X and Y tile, too) but was damn worth it! Now maps load, on average, in about 1.4ms (yes, that's right, 1000th's of a second) from the .temp maps.

Change - Map object information location: Moved the map objects to a different array not part of the map's Data() array. See the above feature for why.

Add - Multiple row loading on .temp map: Added a StepSize constant on the .temp map loading routine so you can grab larger chunks of data at a time. Instead of just grabbing all 100 rows one by one, you can grab as many as you want. Hard to test if it is faster, and by how much, since file I/O can be pretty skippy.

Add - Byte buffer HasBuffer: Added a HasBuffer function that will tell if there is a buffer, instead of using .GetBuffer and checking the UBound of it.

Fix - Erase ByteBuffer instead of ReDim: Changed the byte buffer .clear command to erase the byte buffer instead of redim, which removes an extra byte from memory, and I assume, would be faster.

Remove - Old NPC variables: Removed some old variables for NPCs that was used for the removed pathfinding AI algorithms.

Change - Waterfall equation: Changed the waterfall equation to look a bit better.

Change - Server map UDT order: Had to switch around the order of variables in the map tile UDT in order to get the CopyMemory to work correctly.

Add - Map.temp files / fast map loading: Added .temp files which are created at server runtime. They are basically a very simple, uncompressed, bulky version of the map files. In order, the file contains the number of NPCs, the information on each NPC with a special UDT (storing the X, Y and NPCNumber values), then a full dump of the map tile. Values such as NPCIndex, UserIndex and object information are all removed before saving. The values are written row by row instead of tile by tile, and using the CopyMemory API, directly impliment the data into the map UDT. In comparison to the old map file loading, this loads anywhere from around 70-120x faster, allowing on-the-fly map loading to be a reasonable task. The .temp files are automatically deleted on server unloading.

Fix - Thrall NPC array memory leak: Fixed thralled NPCs to be set NPCActive flag to 0 when killed, allowing their index to be reused when a new NPC is created.

Fix - NPC loading memory leak: Fixed the NPC slots to be recycled for NPCs unloaded from unloaded maps.

Change - Map auto-loading and unloading: Made the maps that are unused unload automatically from memory when the last user on the map leaves the map. This will allow you to create as many maps as you want without a worry about the memory usage each map takes (19kB as of now for the map tiles alone). Also saves CPU cycles since the NPCs on that map are removed, so they are no longer on in the NPC list going through the AI loop.

Change - MapData() moved into MapInfo(): Moved the MapData values into the MapInfo array. It is called the same way, but by MapInfo().Data() instead of MapData().

Fix - Map NumUsers clearing on last map: Fixed the map of the highest index to remove a user from the NumUsers count if they log off while on that map.

Fix - MySQL_RemoveOnline: Fixed up the online state removing routine to use a better, cleaner method.

Fix - Buying message: Fixed the buying message to say the cost instead of <cost>.

Fix - Clearing write message screen: Made the compose mail screen clear before it shows so there is no artifacts left from the last message sent.

Add - Close amount window when walking: Amount window will now close if you walk with it open.

Change - No walking when writing mail: If the mail composing screen is up, you won't be able to walk. This should help prevent against loosing your message when accedently moving (such as if you click but miss one of the input boxes).

Add - Client-side mail spamming check: Added a client-side mail spam check to go with the server-side mail spam check, so if a user does send messages too fast on accedent, it just won't do anything, instead of closing the screen and killing their message

Change - Mail sending packet: Changed the mail sending packet to send only the used slots (since the objects are automatically sorted so the unused are at the end), so at the cost of an extra byte, only the set objects are sent, saving a lot in the long run.

Fix - Mailbox object updating: Fixed the mailbox to update the objects correctly when grabbing items out of the mailbox.

Fix - Attacking with no weapon crash: Fixed the server to not crash when trying to attack with no weapon equipted.

Add - Item removal on mailing: When mailing, the server will take away the user's items, and empty out the inventory slot / unequip items as necessary.

Fix - Mail item duplicating: Added server-side check to make sure users don't try to send multiple copies of the same object slot in a single message.

Fix - Mailing correct objects: Fixed the mailing routine to mail the correct objects (or should I say, inventory slots).

Fix - Byte buffer without logging: Fixed some error handling that was marked as log lines. The log lines were left there, but after them, I added another check (just to exit the function instead of going to the error handler) after them. If logging is used, these wouldn't be reached anyways, so it has no affect on the logging system.

Fix - Item descriptions on nonexistent mail slots: Fixed the server from crashing when requesting information on a mail slot that doesn't have an item in it.

Fix - Mailing empty item slots: Fixed the server to not crash when sending mail information on mail where not all the object slots are used.

Change - Server_MailMessage object passing: Server_MailMessage now takes an array of Objs instead of strings representing values to create the objects for mail.

Add - Write message window object handling: You can now put objects in the write message window the same way you throw them on the floor (it automatically goes to the window if it is open). You can also right-click the object slot to view the item information in the window just like you can with your inventory.

Fix - Right-clicking write message window: Fixed the write message window to check for right-click events.

Change - NonRetPings unloading value: Changed the number of NonRetPings to unload the engine to 200 instead of 5. 5 is recommended for official releases, but 200 is better for debugging.

Add - Buffer force overflowing: Added a sub to the byte buffer that will force overflow the read position, breaking the packet read loop.

Fix - Server_MailMessage: Fixed the mailing to sending a long for the grh value to sending an integer.

Fix - Write message moving: Fixed the write message window to be able to be dragged like the other windows.

Add - NPC AI 4 and 5 improvement: Added 2 more sub directions to the running AIs (4, Ninja, and 5, Cleric) that will allow the NPC to run away when pinned up against a wall. Combined with checking the two adjacent angles away from the PC, it also checks the two adjacent angles to that, allowing to run at 0, 45 and 90 degrees.

Fix - NPC AI 4: Fixed the 4th NPC AI to put on an action delay of 1000ms when no events can take place (a PC is in range, but can not be attacked nor is close enough to make the NPC run).

Fix - NPC AI 3: Fixed the NPC AI to, if no path can be found from the 3 directions (primary and two secondary) to reach the player, an action delay of 1000ms is put on to prevent flooding the AI routine.

Fix - Running NPC AI attacking when cornered: When a fleeing ranged-attacker NPC (AI 4, used on Ninja) gets cornered and can't move away at all, it will attack instead of cowarding in the corner. This also fixes an "action leak", which will help the performance.

Fix - Valid target path checker: Fixed up the ClearPath function to return the correct values for diagonals. Operantly, when you were right next to the only blocked attack tile, it wouldn't pick it up.

Add - Skill_Strengthen_NPCtoNPC: Added the routine to allow NPCs to cast strengthen on each other.

Add - Face direction to who you cast spells on: Added a heading change routine in the spells subs so characters will face the person they cast the spell on.

Fix - Server_FindDirection: Fixed Server_FindDirection to set the heading to North if the same position is passed for both of the positions.

Fix - NPC heading on attack: Fixed the NPC heading on attacking - before, the heading would just be update client-side, and not server-side.

Remove - Engine_GetAngle from server: Removed the GetAngle from the server to get the heading, and replaced it with Server_FindDirection instead, which is pretty inaccurate for straight directions, but a hell of a lot faster.

Personal tools