Menu

Proposals

Anonymous Christian Walther Andrea Viarengo Seryous James C.  Wilson
Attachments
3ppi-scheme.png (2191 bytes)

Introduction

This page would to be a place where post and discuss about new Pipmak features proposals. You can post here just an idea and/or a full implementation of that.

Status of the propsals:

Included yet

Proposed

Rejected

Contributing are welcome!

A clock

Included since version 0.2.7

When playing in fullscreen mode, one has no chance to take a look at the clock. So it would be good if pipmak displayed the time when the user wants to know it. This feature could be easily implemented using lua. However pipmak does not provide the os package of lua, so we can not use the os.time function. So, how to get the time?

You can use

os.date()

Named nodes

Proposed

When dealing with more than a handful of nodes, numbered nodes become unwieldy and every node has the same "node.lua' file, which is hard to track if one has multiple rooms open in their editor. If there is some big advantage to the current system other than legacy, it would be good to see it described.

Better error handling with Image costructor

Proposed

Pipmak.getimage() pipmak.newimage() doesn't work with standard lua "pcall" and "xpcall"

I would like write code like this:

  res,img=pcall(pipmak.getimage,"image_small.png")
  if res==false then
     img=pipmak.getimage("image_full.png")
  end

which doesn't produce error if image_small.png isn't found (and in that case pipmak use image_full.png)

Add width and height to pipmak.getimage(image) and pipmak.newimage(image)

Proposed

Which scale image to that size, because the load image operation consume a lot of time, adding possibility to fix width and height, I could reduce the memory which I need for every image, without the need to resize my image file with a external program...

For example, I could draw patches near the observer more detayled than far patches

Using power of two factor to scale images (simple to implement) could be sufficient...

Depth buffering

Proposed

Implement pipmak.setdepthbuffer(true|false) which it will work only on 3d patches (with the default is false) Permit to respect geometrical order of the patches, or the order which I have used to draw.

(SDL could manage depth buffer)

Pixel size of a String

Proposed

A function which will return the horizontal and vertical size in pixel of a String.

Adding onsoundstop method

Proposed

This could permit execute some action at the end of a sound, or concatenate a lot of sounds (for example to build a vocal message using sounds of the words)

  mysound = sound "mysound.ogg"
  mysound:onsoundstop (
    function ()
    ....
    end)

Adding plugins/library

Proposed

Plugins are similar to "Pipmak resouces", with own node, graphics and lua code,

for the moment we call these "Pipmak libs". Plugins are located in a folder called "plugins" or "lib" At start up, pipmak load all the default.lua which it found inside all "pipmak lib" files inside "plugin" folder Plugin have own node numbering system, we can go to node inside lib changing nodespace from main "/" to "/Mylib"

 pipmak.setnodespace(ns)

(like an unix cd) or retrive the current nodespace with

 pipmak.getnodespace()

(like unix pwd),in this way I could have project and pipmaklib package with nodes numbered with the same number...

pipmak.gotonode and pipmak,overlaynode could have another parameter to indicate nodespace.

In this manner we can create a lot of modules/plugins and it should be sufficient only copy to the lib folder to make available new features build on basic pipmak API, without the need to modify "Pipmak Resources" or act some pipmak.dofile...or add other nodes/resource to the project.

Example of modules could be "onscreendisplay text" "color managment", "inventory managment", "dialog managment", "menu managments" and more modules with use standard Pipmak API to create more complex (but more simple to use) functions.

Adding pipmak.getplatform()

Proposed

 pipmak.getplatform()
 or 
 pipmak.getos()

which return one of {"win","linux","osx"} could permit to load correct .dll or .so depending of the OS, without the need to have different lua code for different OS

GUI elements

Proposed

Complete GUI elements for general use (windows, button, checkbox,....)

Errors review

Proposed

A window which permit to review last error occurred, with scrolling cursor

Standard output copy

Proposed

A switch that permit do echo messages on a file (stdout+stderr) on Windows

Preference node

Proposed

A more nice preference panel with checkboxes and possibility to save/load preferences to a file, also in a programmatically way.

Debug facilities

Rejected

I think it could be very useful a function like "pipmak.pause(key)" that stops running until the pressing of the key "key" and show message "Press <key> to continue", or better show a little overlayed window with the button "continue", so I could examine tables also inside function, or execute some code from a breakpoint to another breakpoint, in this manner, with a very little waste of coding efforts, we could have a minimal,but useful debugging tool.

Rejected because the synchronous nature of Pipmak, an external debugger tool would be an easier solution.

3D patch rotation order

included since build 203

Implements rotation order along x, y, or "a" (perpendicular axes) because the difficult to place 3d patches in particular places.

Setting screen resolution

Included since version 0.2.7

There are three functions in Pipmak to control screen resolution:

  • pipmak.setfullscreen( [smaller] ) increments (smaller=false or absent) or decrements (smaller=true) full screen resolution
  • pipmak.setwindowed() displays Pipmak in a resizable window, starting out at 640 x 480 pixels
  • pipmak.screensize() return screen resolution or pipmak window size.

At the moment, with this set of methods, is difficult to set a particular screen resolution.

My idea is to add a new method pipmak.getscreenmodes() and a new calling schema for the function setfullscreen().

  • pipmak.getscreenmodes() return a table which contain all possible modes supported by the hardware.
  • pipmak.setfullscreen( [smaller] | [width,height] ) if I pass to the function a boolean or nothing, this method continue to work as described above, else if I pass two number width and height this method set directly the screen resolution. If the resolution width x height isn't found in the lists of possible modes supported by hardware, the lower and nearest resolution will be taken.

Lua example: Getting all screen modes supported

  modes={}
  modes=pipmak.getscreenmodes()

  n_modes=table.getn(modes)
  for i=1,n_modes do
    pipmak.print("mode nr. ",i," = ",modes[i].w," x ",modes[i].h)
  end

Notice that elements of table modes are tables too (with index w and h)

Possible implementation

You can found "C" code for implementing this idea Here

Choosing the right resolution

Always remember that the right resolution depends on the hardware of the user, not on your game! This is because Pipmak does interpolation. Todays screens (this does not count for crt screens) often use exactly one resolution. If the graphics card provides a different resolution, the screen actually does interpolation. It is much better to do the interpolation on the graphics hardware, since it can do it better. (The graphics card actually has much more information available to do the rendering than the screen would have to do interpolation.) The conclusion is that the screen resolution should always be set by the user. One could also take the current resolution of the XServer (on UNIX) or of windows.

(Btw: This does not mean that the proposed feature is a bad idea.)

Urs, you are in the right, the game shouldn't have to set a particular resolution for its initiative , but only permit to gamer to set the resolution that he wants, for example providing buttons or options to set it.

So we could also provide another function which get the current screen resolution of the running OS:

desktop_width,desktop_height = pipmak.desktopsize()

This permits to direct switch to fullscreen using current screen resolution set by the user in the OS with:

pipmak.setfullscreen(desktop_width,desktop_height)

We could retrieve info on actual desktop resolution with SDL_GetVideoInfo() if with call it before SDL_SetVideoMode()

I have added this to "Possible implementation"

Automating file icon association in Windows

The article "How to associate projects and saved games to Pipmak on Windows" describe very well the Windows Registry modifications to get association between file .pipmak and .pipsave to their icons.

For who that doesn't known what is it the Windows Registry, I can explain that it exists only on Windows OS and it is a database containing settings collection, from system settings (for example Computer name or IP address) to specific application settings like windows location, default path and so on.

From version 3.1 of Windows it has replaced the use of file .INI (similar to MacOS preference files), and sometime is source of a lot of problems in this platform.

If you take a look on the registry keys, you can see that the full path of the exe is written in the keys, so, if you move pipmak.exe in another folder you have to change the value of the keys...otherwise pipmak and pipsave files loose their icons association (you will see this only at next logon).

The solution to this is automating registry writing at application startup, using this algorithm:

At startup Pipmak must do:

  1. checks if exists the keys [HKEY_CLASSES_ROOT\.pipmak]
  2. checks if exists the keys [HKEY_CLASSES_ROOT\.pipsave]
  3. checks if exists the keys [HKEY_CLASSES_ROOT\PipmakProj\shell\open\command] and get the value
  4. if at least one previous checks are negative or the value of [HKEY_CLASSES_ROOT\PipmakProj\shell\open\command] is different from current exe location (got with C function: GetModuleFileName()
    1. Write or update all registry key using current exe full path
    2. Rebuild Windows Icons calling SHChangeNotify( SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0,0 ) (so you don't need to logoff and logon to see file icons) (this opeartion is similar to MacOS 7-9.1 Desktop Rebuild)
  5. if all checks are positive do nothing

Normally this should be done by a Setup Program, but Pipmak haven't, (and probably is better that it was in this way).

Possible implementation

You can found "C" code for implementing this idea Here

Third Person plug-in theory

Due to request, I had decided to plan how a 3th-person system should work.

Items required

  • Characters
  • Objects
  • Rooms
  • GUI

Characters

Each char has made up by sprites, a sequence of spites determinate an animation (normal,walking,idle,talking...). We can identify each animation 1)by name(string) 2)by number(integer),more versatile. It has an "hot-point" that can be the center or better located on the bottom center.

  • 1st proposal

Sort all animation for character

./chars/indy/walking/001.png
./chars/indy/walking/002.png
./chars/indy/walking/....png

./chars/indy/talking/001.png
./chars/indy/talking/002.png
./chars/indy/talking/....png

It would be somthing as indy:animate("talking")

  • 2nd proposal

Group all animation, so we can use them not only for make chars but also effect

./anim/1/
./anim/2/
./anim/3/
...
./anim/40/

By this way we have to match an action with the animation number:

_indy.talk=3 _ indy.idle=2__

than: indy:talk() or indy:idle()

Objects

Objects are like Characters but react to actions as "talk" "pick" "use" etc..

Rooms

Well, now come the difficult! Let's see how is made a room:

  • is divided in "ground" and "air"
  • contains walkable and non walkable areas
  • walk-behind areas
  • hotspots/regions
  • can be animated
  • light & shadow areas

  • The 2 lines determinate the level of the zoom of the char/object: how low is the second line's percentage, how far go the characters"
  • When the mouse enter an hotspot we can change cursor,and show tooltips.

the "actions" works as the "items" of the inventory in the Pipmak DEMO Project. But how determinate the collision with the hero?

  • Light&shadow can be obtained overlaying a black and white image with an alpha channel

Authoring features on Pipmak

Proposed

Introduction

From version 0.2.6 Pipmak has introduce the possibility to create a "New projects", in next paragraphs I will try to analyze possible evolution of this features.

New node creation

Selecting "New projects", Pipmak create a small project with only 1 cubic nodes, which have the same picture on every face of the cube. After this you have to complete your project using only the text editor and write a lot of lua code. This probably is good for people who have familiarity with programming, but it could discourage the newbies.

Loading cubic image

Pipmak must have two modality of operation:

  1. running mode: In this mode you can play with the project
  2. authoring mode: In this mode you can design the game and add some objects

In authoring mode, when you click on a face, The face will become highlighted and you get a menu which permit to load an image on that face. Could be useful also have possibility to rotate the image after loaded (this is particularly useful for face "top" and "bottom")

This rotation could be realized in two different manner:

  1. physically modifying the original image file.
  2. add some parameter to cubic primitive to specify image rotation.

The menu must permit also other function, for example modify some properties of the node, for example loading or stopping music.

Off course, the lua code of the node automatically will be modified reflecting the image loading.

Setting hotspots

After loaded all six image of the node, we should set the hotspots, for example drawing rectangular area on the spherical projection of the cube.

After create an hotspots, click inside, will highlight it, and another contextual menu permit to connect this hot spot with another node, specifying also the transition type.

If we haven't other nodes we could create a new one empty, otherwise we could choice it from a list of all project nodes. List could be a simply one, or complex one showing all the interconnections between nodes (in a graphical or a textual mode) Highlight with different color one-way connection (i.e.: we could reach a node, but we couldn't return) and node without connection. This wizard will modify the lua code adding handle to manage the new hot spot created

Setting/getting patches

After specify all hotspots and their properties (transitions, transition sounds, node to link, ...)

We could interactively place some patches in an analogous way as "Setting hotspots".

In addiction we could also identify (with mouse) a patch area on the cube and save the cut picture inside that area as a separated image file, to simplify next image operation (for example I would change something inside that file and I would reload the image after some gamer operation.

Adding lua code

With the wizard describe above,for simple project probably we haven't to add any extra lua code to our nodes, but for complex project the wizard must permit to modify lua code automatically generated.

All code added from the user must be preserved by erasing if we recall again the wizard. It would not be badly that Pipmak had a lua editor embeded with syntax highlighting, and methods/function auto-completion feature (a little IDE....)

Probably having an embedded lua editor could permit to add also a lua debugger, to run step by step our lua nodes.

Temporary solution

  • On Windows is possible to launch SciTE instead notepad.exe including in the pipmak-xxx-windows.zip the file SciTE Sc1 version in order to avoid files proliferation.
  • Merge Pipmak code with SciTE which is Windows or GTK+ so remaining platform indipendent.

Disabling player Panoramic Rotation

Proposed

A way to stop the player from rotating the panorama. This could be used for smoothly rotating the panorama to another direction without the player interfering, or it could be used for a Riven-style slideshow navigation option.


Related

Wiki: Getscreenmode_Implementation
Wiki: Main_Page
Wiki: Windows_File_Association
Wiki: Windows_Registry_Implementation