Jibble

Author Topic: Using Normal Maps (demo)  (Read 1351 times)

Using Normal Maps (demo)
« on: 09 Dec 2017, 22:38 »
Ok, so today I lost some hours of my life coding NormalMap with AGS Script.

In case you want it, Download the Demo here!.

I don't think it looks good, I decided to ditch this idea, but maybe someone wants to try and test this.

I based my code on the code here.

If someone does make it better, faster, please share your enhancemets here!


Jack

  • Think deviant
    • I can help with AGS tutoring
    • I can help with scripting
    • I can help with story design
    • Jack worked on one or more games that was nominated for an AGS Award!
Re: Using Normal Maps (demo)
« Reply #1 on: 09 Dec 2017, 23:24 »
This is awesome.

Danvzare

  • The Man with No Name
    • I can help with AGS tutoring
    • I can help with proof reading
    • I can help with scripting
    • I can help with voice acting
    • Danvzare worked on one or more games that was nominated for an AGS Award!
Re: Using Normal Maps (demo)
« Reply #2 on: 10 Dec 2017, 12:42 »

selmiak

  • ǝsıɔɹǝxǝ ʞɔǝu puɐ uıɐɹq
    • I can help with play testing
    • I can help with proof reading
    • I can help with translating
    • I can help with web design
    • selmiak worked on one or more games that won an AGS Award!
    •  
    • selmiak worked on one or more games that was nominated for an AGS Award!

Dualnames

  • AGS Baker
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: Using Normal Maps (demo)
« Reply #4 on: 08 Mar 2019, 03:46 »
"WARNING - There has been no post in this topic for at least 120 days"

Dualnames: "Son, I know what I'm about, leave me be"

https://twitter.com/Dualnames/status/1103864496626446336
No more military army stuff. I'm alive and back.

Re: Using Normal Maps (demo)
« Reply #5 on: 08 Mar 2019, 13:09 »
I read so many posts from the dude with anime Rachel pic when I was learning AGS that I am really happy to have done something that turned out useful for you :)

Dualnames

  • AGS Baker
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: Using Normal Maps (demo)
« Reply #6 on: 08 Mar 2019, 16:04 »
I'm sorry u had to go through my posts.
No more military army stuff. I'm alive and back.

Dualnames

  • AGS Baker
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
No more military army stuff. I'm alive and back.

Monsieur OUXX

  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: Using Normal Maps (demo)
« Reply #8 on: 12 Mar 2019, 15:35 »
I imagine that the normals map has to be exported then imported into AGS at some post? If that's correct, then under which format is it done?
 

Re: Using Normal Maps (demo)
« Reply #9 on: 12 Mar 2019, 16:34 »
@Monsieur OUXX, you are not wrong, but Dualnames is a crazy brilliant person who also added dynamic normal maps creation if you don't provide one.

Dualnames

  • AGS Baker
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: Using Normal Maps (demo)
« Reply #10 on: 12 Mar 2019, 16:43 »
This particular test has normal maps generated by the plugin
No more military army stuff. I'm alive and back.

Monsieur OUXX

  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: Using Normal Maps (demo)
« Reply #11 on: 12 Mar 2019, 16:49 »
This particular test has normal maps generated by the plugin

So what's the strategy? Do you need to pass a greyscale sprite and the pixel's grey value provides the orientation of the pixel?
 

Re: Using Normal Maps (demo)
« Reply #12 on: 12 Mar 2019, 16:55 »
I think it accepts a rgba bitmap as a sprite where color to displacement maps RGB to XYZ

X: -1 to +1 :  Red: 0 to 255
Y: -1 to +1 :  Green: 0 to 255
Z: 0 to -1 :  Blue: 128 to 255

Dualnames

  • AGS Baker
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: Using Normal Maps (demo)
« Reply #13 on: 12 Mar 2019, 18:46 »
Nope, the plugin grayscales it for you, u define the 'intensity' of that. You literally just do

DrawNormalMap(int sprite, int id) where sprite is the sprite you're importing and id is the id of the normal map, and it generates a normal map
So if you use a dynamic sprite you can use that to feed to the next function which Creates a normal map 'pattern' out of a normal map and a sprite.
« Last Edit: 12 Mar 2019, 18:47 by Dualnames »
No more military army stuff. I'm alive and back.

Monsieur OUXX

  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: Using Normal Maps (demo)
« Reply #14 on: 13 Mar 2019, 07:58 »
Nope, the plugin grayscales it for you, u define the 'intensity' of that. You literally just do

DrawNormalMap(int sprite, int id) where sprite is the sprite you're importing and id is the id of the normal map, and it generates a normal map
So if you use a dynamic sprite you can use that to feed to the next function which Creates a normal map 'pattern' out of a normal map and a sprite.

Perfect! All of you!
 

Dualnames

  • AGS Baker
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: Using Normal Maps (demo)
« Reply #15 on: 20 Mar 2019, 11:44 »
I've uploaded both the AGS project file and the source code of the plugin here, https://github.com/Dualnames1/AGSNormalMap I'm working on other stuff right now, so it's hard for me to progress with this currently, i'll come back to it, definitely.
No more military army stuff. I'm alive and back.

Monsieur OUXX

  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: Using Normal Maps (demo)
« Reply #16 on: 10 Apr 2019, 14:01 »
I've uploaded both the AGS project file and the source code of the plugin here, https://github.com/Dualnames1/AGSNormalMap I'm working on other stuff right now, so it's hard for me to progress with this currently, i'll come back to it, definitely.

That is awfully generous of you. Thank a lot!
 

Dualnames

  • AGS Baker
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: Using Normal Maps (demo)
« Reply #17 on: 10 Apr 2019, 17:10 »
I don't mind <3
No more military army stuff. I'm alive and back.

jhonberg

  • In pixels we trust
Re: Using Normal Maps (demo)
« Reply #18 on: 15 Apr 2019, 12:29 »
Ok, so today I lost some hours of my life coding NormalMap with AGS Script.

In case you want it, Download the Demo here!.

I don't think it looks good, I decided to ditch this idea, but maybe someone wants to try and test this.

I based my code on the code here.

If someone does make it better, faster, please share your enhancemets here!



Great Scott!!! what kind of sorcery is this!!

Re: Using Normal Maps (demo)
« Reply #19 on: 07 Jun 2019, 00:57 »
Hey, I tried to workout the building of Dualnames Normalmap plugin here. Thing is when actually trying to use, well, it's working on Windows, but I am getting an error under linux:

Error: Plugin 'agsnormalmap' is an old incompatible version.

Does anyone knows why I am getting this error? (I found it comes from agsplugin.cpp)

Spoiler: ShowHide
Code: Bash
  1. Adventure Game Studio v3.4 Interpreter
  2. Copyright (c) 1999-2011 Chris Jones and 2011-2019 others
  3. ACI version 3.4.3.1
  4.  
  5. Initializing allegro
  6. Initializing game data
  7. Located game data file: /home/erico/git/AGSNormalMap/AGSProject/Compiled/Linux/data/AGSProject.ags
  8. Opened game data file: game28.dta
  9. Game data version: 49
  10. Compiled with: 3.4.3.1
  11. Setting up game configuration
  12. Logging scipt to "warnings.log"
  13. Setting up window
  14. Initializing TTF renderer
  15. Initializing mouse: number of buttons reported is 3
  16. Checking memory
  17. Data directory: /home/erico/git/AGSNormalMap/AGSProject/Compiled/Linux/data
  18. Initializing keyboard
  19. Install timer
  20. Sound settings: digital driver ID: 'Auto' (0xffffffff), MIDI driver ID: 'Auto' (0xffffffff)
  21. ALSA lib rawmidi_hw.c:233:(snd_rawmidi_hw_open) open /dev/snd/midiC0D0 failed: No such file or directory
  22. Warning: cannot enable MIDI audio.
  23. Problem: No compatible drivers found in the system..
  24.  
  25. You may supress this message by disabling MIDI sound in the game setup.Installed digital driver ID: 'ALSA' (0x414c5341), MIDI driver ID: 'None' (0x0)
  26. Install exit handler
  27. Initialize path finder library
  28. Game GUI version: 118
  29. Requested script API: v3.4.1 (5), compat level: v3.3.4 (2)
  30. Plugin 'agsnormalmap' loading succeeded, resolving imports...
  31. An internal error has occurred. Please note down the following information.
  32. If the problem persists, post the details on the AGS Technical Forum.
  33. (ACI version 3.4.3.1)
  34.  
  35. Error: Plugin 'agsnormalmap' is an old incompatible version.
  36. ***** ENGINE HAS SHUTDOWN
  37.  
« Last Edit: 07 Jun 2019, 01:02 by eri0o »