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!
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()
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.
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)
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...
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)
Proposed
A function which will return the horizontal and vertical size in pixel of a String.
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)
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.
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
Proposed
Complete GUI elements for general use (windows, button, checkbox,....)
Proposed
A window which permit to review last error occurred, with scrolling cursor
Proposed
A switch that permit do echo messages on a file (stdout+stderr) on Windows
Proposed
A more nice preference panel with checkboxes and possibility to save/load preferences to a file, also in a programmatically way.
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.
included since build 203
Implements rotation order along x, y, or "a" (perpendicular axes) because the difficult to place 3d patches in particular places.
Included since version 0.2.7
There are three functions in Pipmak to control screen resolution:
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().
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)
You can found "C" code for implementing this idea Here
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"
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:
Normally this should be done by a Setup Program, but Pipmak haven't, (and probably is better that it was in this way).
You can found "C" code for implementing this idea Here
Due to request, I had decided to plan how a 3th-person system should work.
Items required
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.
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")
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 are like Characters but react to actions as "talk" "pick" "use" etc..
Well, now come the difficult! Let's see how is made a room:
the "actions" works as the "items" of the inventory in the Pipmak DEMO Project. But how determinate the collision with the hero?
Proposed
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.
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.
Pipmak must have two modality of operation:
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:
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.
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
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.
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.
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.
Wiki: Getscreenmode_Implementation
Wiki: Main_Page
Wiki: Windows_File_Association
Wiki: Windows_Registry_Implementation