Author Topic: [XP][VX][VXA] Rpg.NET - Developer Release (Updated 7.30.14)  (Read 13472 times)

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Rpg.NET
Authors: ForeverZer0
Version: 0.28A
Type: Managed RGSS API
Key Term: Scripting Tool

Introduction

Rpg.NET is an API built using the .NET Framework for both improving performance and enhancing the RPG Maker series (XP, VX, and VXA). Contained within are various functions and classes that extend the ability of RPG Maker in areas such as graphics, audio, and Windows API interop. Included is a Ruby script that is the wrapper around the library, so it can be used as any other script within your game.

Features

Graphics
  • Lag-Free Particle Engine
  • Save Bitmap as *.png, *.jpg, *.bmp, *.gif
  • Load Bitmap from *.psd, *.tif
  • Get/Set Bitmap Hue
  • Get/Set Bitmap Saturation
  • Get/Set Bitmap Contrast
  • Get/Set Bitmap Brightness
  • Get/Set Bitmap Gamma
  • Bitmap#draw_text_vertical
  • Bitmap#draw_arc
  • Bitmap#draw_bezier
  • Bitmap#draw_beziers
  • Bitmap#draw_closed_curve
  • Bitmap#draw_curve
  • Bitmap#draw_ellipse
  • Bitmap#draw_line
  • Bitmap#draw_lines
  • Bitmap#draw_polygon
  • Bitmap#draw_pie
  • Bitmap#fill_closed_curve
  • Bitmap#fill_ellipse
  • Bitmap#fill_pie
  • Bitmap#fill_polygon
  • Bitmap#fill_gradient_rect
  • Bitmap#fill_gradient_ellipse
  • Bitmap#fill_gradient_polygon
  • Bitmap#color_mask
  • Bitmap Effect - Invert
  • Bitmap Effect - Pixelate
  • Bitmap Effect - Change RGBA Color Components
  • Bitmap Effect - Soften
  • Bitmap Effect - Gaussian Blur
  • Bitmap Effect - Sharpen (Multiple algorithms)
  • Bitmap Effect - Edge-Detect (Multiple algorithms)
  • Bitmap Effect - Emboss (Multiple algorithms)
  • Bitmap Effect - High Pass
  • Bitmap Effect - Grayscale
  • Bitmap Effect - Poster Effect
  • Bitmap Effect - Bitonal
  • Bitmap Effect - Median Filter
  • Bitmap Effect - Tint
  • Bitmap Effect - Color Balance
  • Bitmap Effect - Solarise

Audio
  • Get duration of audio files, in milleseconds (*.mid not supported)
  • Get duration of audio files, in frames (*.mid not supported)

Utility
  • Get RTP Path(s)
  • Get Full-Path to Resource File
  • Change Window Resolution
  • Show/Hide Output Console
  • Screenshot Window (with or without window frame)

Screenshots

Original Image


(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)

Demo


Rpg.NET Developer Release Demo (v.0.25)

Script

Inside demo. (v.0.25)

Version 0.28A
Script
Rpg.NET.dll (701 kB)


Instructions

As this is not currently a stable release build, I would not suggest using it in a release game at this current time. Although everything within at this time will remain in it, and you can begin to utilize what it has in your game, there are numerous improvements that need to be done,

Compatibility

Should work with RPG Maker XP, VX, and VXA, although testing has only been done with RPG Maker XP. Before final release, all versions will be tested to ensure compatibility.

Requires Microsoft .NET Framework 3.5. This is standard on Windows 7 and higher operating systems, and USUALLY installed on Windows XP and Vista systems if updated normally. If distributing with your game, I would suggest providing the above link just in case.

Credits and Thanks

  • ForeverZer0, for the library and script
  • All those on Chaos-Project who have offered ideas on functions to implement, and those who will continue to do so

Author's Notes

There are still quite a few things to implement, I wouldn't even consider this library 1/4 finished at the current time, so please keep that in mind. I have many planned features that have been suggested yet to implement, as well as many others not yet mentioned, such as Input and Audio extensions, Tilemap rewrites to support greater resolutions, and additional Graphic functions. I would appreciate if you have any ideas, to please share them, I am compiling a list, and slowly working through them, this release is simply to show how progress is coming, and to inspire new ideas.

If you encounter any bugs and/or crashes, please report them here in this thread so that they can be addressed. As I stated earlier, testing is currently only being performed on RPG Maker XP, so there may be errors with VX and VXA that I am currently unaware of.

I would like to hear about your experience as far as performance goes with the graphical functions. I have done my best to maintain the highest degree of performance with Bitmap manipulation, using only pointers to unmanaged memory wherever possible. As of right now, the only functions that do not implement this are the hue, saturation, contrast, brightness, and gamma methods, they use a color matrix, but I am in the midst of re-writing them functions to use unmanaged methods, and compare benchmarks.

The particle generators are rather lame at the moment, and only three very basic types currently exist. I was working more on just getting the underlying engine to work and perform efficiently than develop nice effects, but expect more to come in that area in future releases.
« Last Edit: July 30, 2014, 10:19:15 PM by ForeverZer0 »
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20016
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #1 on: July 23, 2014, 03:28:54 PM »
Lol, Sepia. Now everybody can use it on Instagram.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3206
  • LV: 387
  • Gender: Male
  • Choco Octo <3
    • View Profile
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #2 on: July 23, 2014, 07:06:38 PM »
I don't know if I should go with XX Pro or Valencia--I wanna look tan

I'll be sure to give this a spin and test for performance and the like. Meanwhile, what's your plan for the Tilemap rewrite--using the same theory/method as your Custom Resolution or following the traditional RMXP standards?



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #3 on: July 23, 2014, 07:22:48 PM »
Working on it right now, actually.
At the moment I am loosely following the same formula as the script, using a sprite for each priority, but if I can't remember if there were bugs with that aspect of the script or not. Once I get a working version going, I can make alterations from there.

I do remember I was having some issues with autotile updates, but that problem is now taken care of.

EDIT:
Oops, just noticed I had a link to a page that wasn't there except for admins. Changing it now.
« Last Edit: July 23, 2014, 07:27:51 PM by ForeverZer0 »
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3206
  • LV: 387
  • Gender: Male
  • Choco Octo <3
    • View Profile
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #4 on: July 23, 2014, 07:46:21 PM »
The main issue with that method was wonky z-level sprites. But because of its simplicity and lack of sprites, it provides a better performance at higher resolutions. One of my biggest problems was calling the DLL to redraw the screen many times led to a significant drop in FPS (1024x576 resolution). While I could make bitmaps as big as the map itself (like how Custom Resolution did it) and avoid having to update every frame now, it also eats up my -now- dismal memory. So I tried using 24 sprites/bitmaps as big as the window, redrawing only when I really needed it to. It didn't use as much memory and the update times were pretty solid (~50+ FPS standing still and 45 FPS when moving).

I don't know if this is because of my processor (Intel first gen), but more modern computers seem to handle this fine and keep a steady 60 FPS. It's probably because of my heavy use of memcpy.

I'm pretty sure there's no way to cater to everyone's needs when it comes to larger resolutions. Maybe I should just accept that and stop finding a way to keep performance good for computers built in 2010 or older.



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #5 on: July 23, 2014, 08:22:22 PM »
I don't understand why you would need to redraw so many times. Aside from autotiles, the map only needs drawn once, and for them you only need to redraw that specific area if it's within the visible screen.

As for using memcpy, have been steering clear of that method so far. I started using RtlCopyMemory (same as memcpy), but I found it far more efficient to just edit the bytes in place when it comes to Bitmaps, and there is far less RAM use not making copies of everything.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3206
  • LV: 387
  • Gender: Male
  • Choco Octo <3
    • View Profile
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #6 on: July 23, 2014, 08:36:21 PM »
If you plan on drawing a whole 500x500 map, you're going to need 3GB+ of memory to pull that off. Even a 200x200 requires 1GB or so. Thus, to combat this, I only make bitmaps as big as the game's window so I have to still redraw but at a fraction of the cost.

I'll take a look at that method and see if I notice any changes.



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #7 on: July 23, 2014, 08:58:45 PM »
True, I did some quick math and a 500x500 map with 6 bitmaps (each priority) comes to 6.144 GB.
That's pretty bad, lol.

Only drawing the screen is pretty good on RAM. The standard 640x480 screen with 6 bitmaps is a little less than 7.5 MB.
I think I will do some blend of the two. I created an RMXP editor using XNA a year or so ago (never quite finished yet...), and I had good performance only drawing the visible screen, but obviously my methods there were different.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Zexion

  • Addicted to LoL
  • Chaos User
  • ******
  • Posts: 1519
  • LV: 69
  • Gender: Male
  • My anaconda don't...jk it does
    • View Profile
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #8 on: July 23, 2014, 10:35:31 PM »
for some reason, chrome does not even let me touch this xD

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #9 on: July 23, 2014, 10:50:40 PM »
for some reason, chrome does not even let me touch this xD

As in, you can't go to the page, or you just can't download it? I only ask because I am trying out Orangedox right now, which tracks download counts from Dropbox, thought maybe it has something to do with that. You could always try a different browser, Chrome is funny like that sometimes...


@KK20:
I was thinking about the Tilemap thing again. Since recalculating and drawing the whole window every time the ox or oy changes is obviously inefficient, what if you only draw the a new row or column of tiles, depending on which way the origin changed, and simply copy the rest of the screen over. Just keep like a 64 pixel buffer around the screen of drawn material, and update it every time the origin moves more than 32 on either axis. Your actual Bitmap sizes will only be 768x608 at the max (if using 640x480) resolution, but will only need updated a fraction of the time, and most of that is just a large block transfer, only a the new edge will need recalculated and drawn from scratch.

I think I am going to attempt something similar to this. It should *hopefully* be a minimal on RAM, and vastly limit the number of times and how much of the screen needs redrawn.
« Last Edit: July 23, 2014, 10:59:29 PM by ForeverZer0 »
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Zexion

  • Addicted to LoL
  • Chaos User
  • ******
  • Posts: 1519
  • LV: 69
  • Gender: Male
  • My anaconda don't...jk it does
    • View Profile
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #10 on: July 23, 2014, 11:22:12 PM »
Well at first I couldn't go to the page, but a few minutes later I could :b
Then chrome did that thing where it marks the file as malicious and deletes it automatically. Downloaded it in IE

Edit:
Is it possible to do anti-aliasing on the drawn bitmaps? Like the ellipse/line/etc. ?
« Last Edit: July 23, 2014, 11:31:50 PM by Zexion »

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #11 on: July 23, 2014, 11:49:38 PM »
Is it possible to do anti-aliasing on the drawn bitmaps? Like the ellipse/line/etc. ?

Yes, I just haven't implemented it yet. I need to add Bitmap#.anti_aliasing = BOOLEAN property, and then edit all the drawing methods to draw different ways depending on how it is set. I can also include a static property for the actual class which will set the default for all new Bitmaps so you don't need to set it for everyone. Using higher quality means lower performance, but I don't think its going to make any difference at all with the drawing methods, there isn't much overhead with them at all. There are some optimizations I would like to make them anyways, so I will update them both at the same time when I get the time.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6591
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #12 on: July 24, 2014, 04:12:13 AM »
Dunno if anyone else has noticed this, but as long as I'm moving the mouse over the RGSS window, the game lags or stands still.

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #13 on: July 24, 2014, 04:15:41 AM »
I was testing some mouse input stuff, I may have forgotten to remove it from the demo.
I will check it out and update it.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 851
  • LV: 517
  • Gender: Male
    • View Profile
    • ~
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #14 on: July 24, 2014, 05:07:34 AM »
suggestion :

  • can you separate bitmap effects with destructive & not destructive method (like MACL)?
    ex :
    (click to show/hide)
Code: [Select]
bitmap = Bitmap.new("Pictures.png")
inverted = bitmap.invert

a = Sprite.new
a.bitmap = bitmap # returns original image (not modified)

b = Sprite.new
a.bitmap = inverted # returns inverted image
original bitmap is not modified so it can be used for other methods without reloading the bitmap

Code: [Select]
bitmap = Bitmap.new("Pictures.png")
bitmap.invert!

a = Sprite.new
a.bitmap = bitmap # returns inverted image
    this one modifies the original bitmap

    [/spoiler]
    [/li]
  • add flip_horizontal, flip_vertical

about the tilemap, I was thinking about combining your method & King's method

  • for priority 0 & 5, combine all tile in all layers into one bitmap like custom resolution v9.4
  • for priority 1-4, split it into several bitmap & calculate all the z value like King's tilemap does.
    this probably will solve the z glitch
  • if I can illustrate it, it will be like this:
    (click to show/hide)
  • after drawing all the bitmaps, save the bitmaps as external files so when visiting same map / reload the game,
    you can just load the bitmaps & skip all the drawings



Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3206
  • LV: 387
  • Gender: Male
  • Choco Octo <3
    • View Profile
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #15 on: July 24, 2014, 06:36:50 AM »
@F0
I just recently tried to do that. Even though my redrawing of the edges is wrong, it's still running through the typical amount of code I'd expect it to. FPS went from 50 (standing still) to about 33 (scrolling). And how would one move large blocks of bytes? I just passed in how much ox/oy changes and use memcpy(layer, layer + shiftamount, shiftamount * 4) or something of the like.

@Drago
Well, priority 5 is wrong :P It should follow suit of the 1-4 priority levels as well. But if we can alter the idea of priorities, that'd help cut down on the sprites and bitmaps. I mean, XP is the only engine that has this. All the others have a "*" priority that just symbolizes it's floating in the air.
Also, how big are those bitmaps supposed to be? Screen-sized or entire map-sized? If it's screen-sized, you still have to do some redrawing. Entire-map sized and you're just playing with memory.



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Offline Ryex

  • Arctic Bird of Programming
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 5135
  • LV: 198
  • Gender: Female
  • Wants to write a compiler for fun
    • View Profile
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #16 on: July 24, 2014, 06:52:05 AM »
Levels Earned F0, Levels Earned.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.

DropBox, the best free file syncing service there is.
(click to show/hide)

Offline Spaceman McConaughey

  • Legit Poo Poo Man
  • Lexima Warrior
  • *******
  • Posts: 2002
  • LV: 46
  • Gender: Male
  • muh murph
    • View Profile
    • Titties, titties, and more titties!
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #17 on: July 24, 2014, 07:16:16 AM »
F0, my babies.

Just have them.

I love you!

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 851
  • LV: 517
  • Gender: Male
    • View Profile
    • ~
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #18 on: July 24, 2014, 07:42:47 AM »
@kk20
I was thinking for small / mid sized, entire map is okay,
but for bigger maps, maybe it will be like continuous maps,

and if we can save the drawed tilemaps into external files,
probably it can save some memory if carefully played.
(dispose & reload the bitmap & skip redrawing entire map) .

also, we can cut down the number of sprites if there is no tile in specific rows / priority.
ex: if there are no 'priority 5' tiles in the map,
then we can dispose & replace all 'priority 5' sprites into a dummy (like I did in custom resolution 9.7e)

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP][VX][VXA] Rpg.NET - Developer Release
« Reply #19 on: July 24, 2014, 01:40:00 PM »
can you separate bitmap effects with destructive & not destructive method (like MACL)?

Yes, will do.

Done.

add flip_horizontal, flip_vertical
Done.

And how would one move large blocks of bytes?
The same way one moves any amount of bytes. It takes a couple calculations to factor in the new stride, etc. since you are moving a rectangle of data out of something that is aligned in linear fashion, but it  would have to be more efficient than moving the same number of bytes in 1000 separate operations.

EDIT:
I implemented anti-aliasing for all the drawing methods, I just made it do it by default. There is no loss in performance, and I don't see someone not wanting to use it, so there I didn't include a setting for it, which would just add more to arguments/methods to the Bitmap class.
« Last Edit: July 24, 2014, 03:01:13 PM by ForeverZer0 »
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.