Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Qazek

Members
  • Posts

    133
  • Joined

  • Last visited

    Never

Qazek's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Check Mirage 3.0.7 with MySQL database
  2. One bug - when I equip item and my hp growth, hp bar is longer :P But still engine is very nice, I'm waiting for the next realease :)
  3. Ok, got it :D Thanks for help :)
  4. Blocking print screen is not good xD But look at the code, here is Compressing file: ``` Public Function CompressFile(FilePathIn As String, FilePathOut As String, CompressionLevel As Integer) As Long 'compress a file Dim intNextFreeFile As Integer Dim TheBytes() As Byte Dim lngResult As Long Dim lngFileLen As Long ' Along the way, we are gonna make it look professional and infom the user ' Of the programs actions lngFileLen = FileLen(FilePathIn) 'allocate byte array ReDim TheBytes(lngFileLen - 1) 'read byte array from file Close #10 intNextFreeFile = FreeFile '10 'FreeFile Open FilePathIn For Binary Access Read As #intNextFreeFile Get #intNextFreeFile, , TheBytes() Close #intNextFreeFile 'compress byte array lngResult = CompressByteArray(TheBytes(), CompressionLevel) 'kill any file in place On Error Resume Next Kill FilePathOut On Error GoTo 0 'Write it out intNextFreeFile = FreeFile Open FilePathOut For Binary Access Write As #intNextFreeFile Put #intNextFreeFile, , lngFileLen 'must store the length of the original file Put #intNextFreeFile, , TheBytes() Close #intNextFreeFile Erase TheBytes CompressFile = lngResult End Function ``` And it works with EO and DX8 (tested), but only what I want is to change anything in this function to make my files more difficult to decompress using DecompressFile function. I never worked on a files like that so it's new experience for me ^^
  5. I found this on my cd ;_; ``` Option Explicit 'the following are for compression/decompression Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long) Private Declare Function compress Lib "zlib.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long) As Long Private Declare Function compress2 Lib "zlib.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long, ByVal level As Long) As Long Private Declare Function uncompress Lib "zlib.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long) As Long 'the following are for compression/decompression Dim lngCompressedSize As Long Dim lngDecompressedSize As Long Public Enum CZErrors 'for compression/decompression Z_OK = 0 Z_STREAM_END = 1 Z_NEED_DICT = 2 Z_ERRNO = -1 Z_STREAM_ERROR = -2 Z_DATA_ERROR = -3 Z_MEM_ERROR = -4 Z_BUF_ERROR = -5 Z_VERSION_ERROR = -6 End Enum Public Enum CompressionLevels 'for compression/decompression Z_NO_COMPRESSION = 0 Z_BEST_SPEED = 1 'note that levels 2-8 exist, too Z_BEST_COMPRESSION = 9 Z_DEFAULT_COMPRESSION = -1 End Enum Public Property Get ValueCompressedSize() As Long 'size of an object after compression ValueCompressedSize = lngCompressedSize End Property Private Property Let ValueCompressedSize(ByVal New_ValueCompressedSize As Long) lngCompressedSize = New_ValueCompressedSize End Property Public Property Get ValueDecompressedSize() As Long 'size of an object after decompression ValueDecompressedSize = lngDecompressedSize End Property Private Property Let ValueDecompressedSize(ByVal New_ValueDecompressedSize As Long) lngDecompressedSize = New_ValueDecompressedSize End Property Public Function CompressByteArray(TheData() As Byte, CompressionLevel As Integer) As Long 'compress a byte array Dim lngResult As Long Dim lngBufferSize As Long Dim arrByteArray() As Byte lngDecompressedSize = UBound(TheData) + 1 'Allocate memory for byte array lngBufferSize = UBound(TheData) + 1 lngBufferSize = lngBufferSize + (lngBufferSize * 0.01) + 12 ReDim arrByteArray(lngBufferSize) 'Compress byte array (data) lngResult = compress2(arrByteArray(0), lngBufferSize, TheData(0), UBound(TheData) + 1, CompressionLevel) 'Truncate to compressed size ReDim Preserve TheData(lngBufferSize - 1) CopyMemory TheData(0), arrByteArray(0), lngBufferSize 'Set property lngCompressedSize = UBound(TheData) + 1 'return error code (if any) CompressByteArray = lngResult End Function Public Function CompressString(Text As String, CompressionLevel As Integer) As Long 'compress a string Dim lngOrgSize As Long Dim lngReturnValue As Long Dim lngCmpSize As Long Dim strTBuff As String ValueDecompressedSize = Len(Text) 'Allocate string space for the buffers lngOrgSize = Len(Text) strTBuff = String(lngOrgSize + (lngOrgSize * 0.01) + 12, 0) lngCmpSize = Len(strTBuff) 'Compress string (temporary string buffer) data lngReturnValue = compress2(ByVal strTBuff, lngCmpSize, ByVal Text, Len(Text), CompressionLevel) 'Crop the string and set it to the actual string. Text = Left$(strTBuff, lngCmpSize) 'Set compressed size of string. ValueCompressedSize = lngCmpSize 'Cleanup strTBuff = "" 'return error code (if any) CompressString = lngReturnValue End Function Public Function DecompressByteArray(TheData() As Byte, OriginalSize As Long) As Long 'decompress a byte array Dim lngResult As Long Dim lngBufferSize As Long Dim arrByteArray() As Byte lngDecompressedSize = OriginalSize lngCompressedSize = UBound(TheData) + 1 'Allocate memory for byte array lngBufferSize = OriginalSize lngBufferSize = lngBufferSize + (lngBufferSize * 0.01) + 12 ReDim arrByteArray(lngBufferSize) 'Decompress data lngResult = uncompress(arrByteArray(0), lngBufferSize, TheData(0), UBound(TheData) + 1) 'Truncate buffer to compressed size ReDim Preserve TheData(lngBufferSize - 1) CopyMemory TheData(0), arrByteArray(0), lngBufferSize 'return error code (if any) DecompressByteArray = lngResult End Function Public Function DecompressString(Text As String, OriginalSize As Long) As Long 'decompress a string Dim lngResult As Long Dim lngCmpSize As Long Dim strTBuff As String 'Allocate string space strTBuff = String(ValueDecompressedSize + (ValueDecompressedSize * 0.01) + 12, 0) lngCmpSize = Len(strTBuff) ValueDecompressedSize = OriginalSize 'Decompress lngResult = uncompress(ByVal strTBuff, lngCmpSize, ByVal Text, Len(Text)) 'Make string the size of the uncompressed string Text = Left$(strTBuff, lngCmpSize) ValueCompressedSize = lngCmpSize 'return error code (if any) DecompressString = lngResult End Function Public Function CompressFile(FilePathIn As String, FilePathOut As String, CompressionLevel As Integer) As Long 'compress a file Dim intNextFreeFile As Integer Dim TheBytes() As Byte Dim lngResult As Long Dim lngFileLen As Long ' Along the way, we are gonna make it look professional and infom the user ' Of the programs actions lngFileLen = FileLen(FilePathIn) 'allocate byte array ReDim TheBytes(lngFileLen - 1) 'read byte array from file Close #10 intNextFreeFile = FreeFile '10 'FreeFile Open FilePathIn For Binary Access Read As #intNextFreeFile Get #intNextFreeFile, , TheBytes() Close #intNextFreeFile 'compress byte array lngResult = CompressByteArray(TheBytes(), CompressionLevel) 'kill any file in place On Error Resume Next Kill FilePathOut On Error GoTo 0 'Write it out intNextFreeFile = FreeFile Open FilePathOut For Binary Access Write As #intNextFreeFile Put #intNextFreeFile, , lngFileLen 'must store the length of the original file Put #intNextFreeFile, , TheBytes() Close #intNextFreeFile Erase TheBytes CompressFile = lngResult End Function Public Function DecompressFile(FilePathIn As String, FilePathOut As String) As Long 'decompress a file Dim intNextFreeFile As Integer Dim TheBytes() As Byte Dim lngResult As Long Dim lngFileLen As Long 'allocate byte array ReDim TheBytes(FileLen(FilePathIn) - 1) 'read byte array from file intNextFreeFile = FreeFile Open FilePathIn For Binary Access Read As #intNextFreeFile Get #intNextFreeFile, , lngFileLen 'the original (uncompressed) file's length Get #intNextFreeFile, , TheBytes() Close #intNextFreeFile 'decompress lngResult = DecompressByteArray(TheBytes(), lngFileLen) 'kill any file already there On Error Resume Next Kill FilePathOut On Error GoTo 0 'Write it out intNextFreeFile = FreeFile Open FilePathOut For Binary Access Write As #intNextFreeFile Put #intNextFreeFile, , TheBytes() Close #intNextFreeFile Erase TheBytes DecompressFile = lngResult End Function ``` And it works perfectly, but if anyone knows that algoritm, then he could easily decompress files.
  6. Hello! I am looking for something what could secure my graphics from stealing I mean compression/encryption with password etc. I am using EO 3.0 with DirectX8.
  7. It looks really promissing :) Is map editor using autotiles?
  8. Ok I found what is wrong, in Sub RenderTexture i found: ``` If sY + sHeight > textureHeight Then Exit Sub ``` But when I remove it it drawing second HP bar under first. Maybe I should use RenderTextureByRects but i don't know how to use it xD
  9. Hey! I need to create vertical HP and MP bars for my game. My code: ``` HPBar = 94 * (GetPlayerVital(MyIndex, Vitals.HP) / GetPlayerMaxVital(MyIndex, Vitals.HP)) HPBar = 94 - HPBar RenderTexture Tex_GUI(1), 0, 16 + HPBar, 0, HPBar, 94, 94, 94, 94 ``` But it only shows HP bar picture when HP > 123\. If hp =< 123, hp bar is unvisible. Any ideas?
  10. Client is loading really long because all graphics are loaded at start. So how to change it to load images only when I need?
  11. Everything. Now i've got all RMVX animations in my game but I need more for battles.
  12. Hello I'm looking for animations in rmvx style for my game. Thanks ;)
  13. Sorry for english This simple fix just stop rendering empty map tile slots. It's really helpfull when you using big maps with autotilesets in your game. Only Client Side Find: ``` DrawMapFringeTile ``` In this sub under: ``` For I = MapLayer.Fringe To MapLayer.Fringe2 ``` Put this: ``` If .Layer(I).Tileset 0 Then ``` And now before: ``` Next ``` Put: ``` End If ``` Now let's go to the DrawMapTile Sub and do the same things (add the same If) like before. In my game I've got 5-10 more FPS :P
  14. I removed some unused things like hotbar, I removed some unused packets, I removed game editors, I changed some longs to bytes (in packets too), I changed max constants to minimum (like only 40 player slots not 70), I optimized PlayerData and PlayerMove packets and subs. Something else? xD
  15. Hello! I need to make my server stable for 20-30 players so my answer is how to do that. Any tricks to optimize NPC's logic or anything else which could be really helpfull?
×
×
  • Create New...