Chaos Project

RPG Maker => RPG Maker Scripts => Topic started by: ForeverZer0 on July 14, 2014, 05:25:55 pm

Title: [WIP] Rpg.NET
Post by: ForeverZer0 on July 14, 2014, 05:25:55 pm
Utility: ShowHide

  • Setting the resolution

  • Getting the handle to the game window

  • Getting the game library

  • Getting the game title

  • Getting the RTP name(s) and path(s)

  • Toggling the console on/off to display output

  • Opening a script window to place script calls while the game is running. (Better than the script I wrote long ago...)

  • Getting list of installed fonts on the system

  • Using the system font picker to change the game font



Bitmap Class: ShowHide

  • Added methods to get/set the saturation, brightness, contrast, and gamma

  • Save a bitmap as *.jpg, *.png, *.gif, *.tiff, *.bmp

  • Implemented draw_arc function

  • Implemented draw_bezier function

  • Implemented draw_curve function

  • Implemented draw_ellipse function

  • Implemented draw_line function

  • Implemented draw_pie function

  • Implemented draw_closed_curve function

  • Implemented draw_polygon function

  • Implemented fill_pie function

  • Implemented fill_ellipse function

  • Implemented fill_polygon function

  • Implemented fill_closed_curve function

  • Additional image formats (*.tif, *.gif, *.psd, etc.)

  • A "snapshot" function that returns a copy of the current client area of the game as a Bitmap

  • Reading PhotoShop's *.psd format and creating Bitmap's from it



I have found some very efficient ways of altering RGSS Bitmaps, and I am quite pleased with the performance thus far. I have not really encountered any type of lag or performance loss while testing yet, and I look forward to seeing how much performance I can get from it.  I have devised a way of copying the RGSS Bitmap data to .NET Bitmaps through a combination of using Window's "MoveMemory" function and the .NET Bitmap's "LockBits" to just shift around memory without any actual casting to types, etc. That combined with all that is available in .NET's Graphics class and the use of a ColorMatrix, there are some neat things that can be done that Ruby cannot perform efficiently.



What I was hoping to get from this thread was some feedback and ideas on other things that could be implemented. I already have a few ideas that I already have plans for, or have already begin implementing, which I will list here, but please feel free to share your thoughts.

Planned or Partially Implemented: ShowHide


[li[Anti-aliasing[/li]
[li]Tilemap rewrite to finally make a good custom resolution system without the performance loss and graphical errors[/li]
[li]Animated color fills (invert, rainbow, etc.)[/li]
[li]HUD (because it updates every frame performance can be an issue in Ruby)[/li]
[li]Tilemap effects (zoom, hue change, etc.)[/li]
[li]Mouse-wheel functions. (Actually already partially implemented a new Input API)[/li]
[li]Change window icon[/li]
[li]lighting / shadows[/li]
[li]Make some suggestions to see them here![/li]
[/list]


Possible: ShowHide


  • particle effects

  • outlines or tooltips (think quest icons from MMORPGs, teammate outlines from Left4Dead, etc.)

  • Networking


[/list]
Title: Re: [WIP] Rpg.NET
Post by: Spaceman McConaughey on July 14, 2014, 05:29:00 pm
Quote from: ForeverZer0 on July 14, 2014, 05:25:55 pm
  • Tilemap rewrite to finally make a good custom resolution system without the performance loss and graphical errors



I love you so fucking much, dood. <3
Title: Re: [WIP] Rpg.NET
Post by: Zexion on July 14, 2014, 06:20:05 pm
Quote from: ForeverZer0 on July 14, 2014, 05:25:55 pm

  • Setting the resolution

  • Added methods to get/set the saturation, brightness, contrast, and gamma

  • Save a bitmap as *.jpg, *.png, *.gif, or *.bmp

  • Implemented draw_arc function

  • Implemented draw_line function

  • A "snapshot" function that returns a copy of the current client area of the game as a Bitmap



I need this in my life
Title: Re: [WIP] Rpg.NET
Post by: PhoenixFire on July 14, 2014, 06:22:01 pm
If you can manage to get networking to work without lag, AND, really easy to implement to the non-scripter scripters (basically, those of us that can read a script, kind of understand it, troubleshoot it on our own, but don't write our own and need help sometimes), well, then I would probably send you  a nice little chunk of whatever profit is made off of any game I make with your stuff in it. You never cease to amaze me sir.
Title: Re: [WIP] Rpg.NET
Post by: LiTTleDRAgo on July 14, 2014, 06:38:46 pm
suggestion?: ShowHide

  • tilemap with zoom & tone change features

  • bitmap anti aliasing

  • draw_3d (from 3dmax / blender) function

  • get bitmap from *.psd & *.tiff function



<3
Title: Re: [WIP] Rpg.NET
Post by: Zexion on July 14, 2014, 06:47:40 pm
question, why would you need a bitmap from a .psd?
Title: Re: [WIP] Rpg.NET
Post by: ForeverZer0 on July 14, 2014, 06:58:36 pm
Will Do:


Maybe In the Future:


Probably Not:


As far as 3D goes, I highly doubt. It would be easier to simply add RGSS support to an existing 3D game maker.
Title: Re: [WIP] Rpg.NET
Post by: winkio on July 14, 2014, 07:16:42 pm
these are all off the top of my head, feel free to choose which ones you want:

lighting / shadows
particle effects
animated color fills (invert, rainbow, etc.)
HUD (because it updates every frame performance can be an issue in Ruby)
outlines / tooltips (think quest icons from MMORPGs, teammate outlines from Left4Dead, etc.)
Title: Re: [WIP] Rpg.NET
Post by: KK20 on July 14, 2014, 07:24:17 pm
Well I look forward to that tilemap rewrite 'cuz I've been having difficulties trying to find a universal implementation that works for both XP and XPAce. But I'm pretty sure it's the sprites that are the problem of performance, not the bitmaps.
Title: Re: [WIP] Rpg.NET
Post by: LiTTleDRAgo on July 14, 2014, 07:59:19 pm
ah, I forgot to include mouse wheel function to suggestion
http://www.mundorpgmaker.com.br/forum/index.php?topic=10055.0

Quote from: Zexion on July 14, 2014, 06:47:40 pm
question, why would you need a bitmap from a .psd?


because I think it probably will save time, instead save as png for every edit, you can save the file as it is for just CTRL + S

Quote from: ForeverZer0 on July 14, 2014, 06:58:36 pm
*.psd &


oh well....
Title: Re: [WIP] Rpg.NET
Post by: Wecoc on July 14, 2014, 10:15:34 pm
This is REALLY epic!

Probably dumb suggestion: ShowHide

  • Icon changer



Once I tried to get and set the game's small icon with Win32API according to the chapter, but I was no able to do it.
It's not very useful but i'm not inspired... xD If you can get the window handle maybe this will be easy.
Title: Re: [WIP] Rpg.NET
Post by: Ryex on July 15, 2014, 01:11:48 am
actually that's probably not an impossible idea. if you can use window hooks and manipulate bitmaps than you should be able to change the window icon.
Title: Re: [WIP] Rpg.NET
Post by: ForeverZer0 on July 15, 2014, 02:41:39 am
Yeah, its an easy thing. I think there is even a simple API function for it.
Title: Re: [WIP] Rpg.NET
Post by: Blizzard on July 15, 2014, 04:40:34 am
There is. You can load the icon image and get its handle like this:

hIcon = (HICON)LoadImage(NULL, "new_icon.ico", IMAGE_ICON, 32, 32, LR_LOADFROMFILE);


And then just change it.

SendMessage(windowHWND, WM_SETICON, ICON_SMALL, hIcon);


In other words: This can be done with play Win32API. And you have to get the window handle. And constants are not there in Ruby so you have to use their numeric values.
Title: Re: [WIP] Rpg.NET
Post by: ForeverZer0 on July 15, 2014, 08:04:42 pm
After a little looking into it, adding support for opening *.psd files is going to be added.
Obviously due to the size of *.psd files it will be slower to open them than a *.jpg or *.png, but at least for debugging purposes it can be used.

EDIT:
Implemented loading Bitmap's using from *.psd format. It was actually much simpler than I anticipated.

For some reason, the edits I make to fix the BB code in the OP do not save, and the formatting is off, so I apologize.
Title: Re: [WIP] Rpg.NET
Post by: ForeverZer0 on July 19, 2014, 03:06:56 pm
* DOUBLE POST *

Mwahahaha. Basic particle system now working. Not a single loss in frame-rate.
Title: Re: [WIP] Rpg.NET
Post by: Zexion on July 19, 2014, 03:31:05 pm
That is sick f0. KK20 and I used an existing particle system which caused a noticeable drop in frames in maps that used it.
Also, what exactly do you mean by HUD? Is there some kind of default HUD that I'm not aware of xD ?
Title: Re: [WIP] Rpg.NET
Post by: ForeverZer0 on July 19, 2014, 03:55:40 pm
Quote from: Zexion on July 19, 2014, 03:31:05 pm
That is sick f0. KK20 and I used an existing particle system which caused a noticeable drop in frames in maps that used it.

It's all about how the drawing is implemented. Directly accessing the memory of bitmaps without any converting, using buffers, and drawing all once is what I have found successful. I am not working with actual Bitmap objects, but merely the area on the RAM where they are located. They are simply stored as a long line of bytes, where every 4 bytes is a color in BGRA format, so knowing that, a lot of manipulation can be done without any casting/converting. I haven't used anything other than GDI for a lot of drawing methods, and I simply copy the C# Bitmap's memory into the place of RGSS's Bitmap's memory.

Quote from: Zexion on July 19, 2014, 03:31:05 pm
Also, what exactly do you mean by HUD? Is there some kind of default HUD that I'm not aware of xD ?

No, there is no existing HUD, but I could probably implement some sort of API to handle the drawing of a HUD.
Title: Re: [WIP] Rpg.NET
Post by: Zexion on July 19, 2014, 04:10:38 pm
Ah that sounds like the complicated stuff that kk20 is doing. I know nothing of casting D:
Quote from: ForeverZer0 on July 19, 2014, 03:55:40 pm
No, there is no existing HUD, but I could probably implement some sort of API to handle the drawing of a HUD.

Ah I see. Combined with your bitmap methods, this could replace my entire HUD xD