|
|||||
|
Just to put a smile on your face, I was able to use Joystick( controller) with the Coppercube game engine and will create API for it so that we can use it easily in Coppercube game engine. So yeah, Controller support will get added in future version of Coppercube. Cheers |
||||
|
Created an Input event API for the controller buttons. ccbRegisterJoyButtonEvent(funcstr) previously I made it to return the button numbers that were pressed down, but now I changed it to return the buttonstate from a bitmask[32]. which means it will allow up to 32 buttons and can be more easily configured with multiple buttons simultaneously pressed. It returns the button state in the power of 2. like [1,2,4,8,16,32,64,128,256,512,1024,2048,4096 and so on] let's say you pressed button 1 and button 3 at the same time then we know that button 1 = 1, and button 3 = 4, as per the above bitmask. So it will sum up the bitmask for button 1 and button 3 which is equal to 5 and will return it. We can then easily use it to check if buttons are pressed in combo and much more. While the button numbers that I was using previously only returned a single button value and didn't allow us to use more buttons at the same time simultaneously. will add axis, pov, and all as input event receivers. Here is a test video showcasing the usage of the controller, it prints the number of buttons that were pressed on the controller in the debug panel, if the number was 1 then it will move the cube ahead on X-axis. 0 means no button was pressed. https://youtu.be/D0VSDiZkqw8 This video was created using the old method, I have updated the code a bit now. let me know what you guys think about the controller support. Edit:- Added POV and Axis input control API ccbActivateJoystick()Activates the controller support for your game. Also returns the Joystick Information like number of buttons, axes, Joystick id, name etc.ccbRegisterJoyButtonEvent(funcstr)return the bitmap mask of the currently pressed buttons.ccbRegisterJoyPovEvent(funcstr)returns Pov value (generally angles)ccbRegisterJoyAxisVerticalEvent(funcstr)returns Axis value vertically -1 for down and +1 for upccbRegisterJoyAxisHorizontalEvent(funcstr)returns Axis value horizontally -1 for left and +1 for rightccbRegisterJoyAxis2VerticalEvent(funcstr)returns second Axis value vertically -1 for down and +1 for upccbRegisterJoyAxis2HorizontalEvent(funcstr)returns second Axis value horizontally -1 for left and +1 for righthashtag.joybuttonpressed.buttonSpecial coppercube variable that returns the button state of the button. I don't have two controllers, so can't check the multiple controller's compatibilities. But the above code works on my controller. Will soon update my GitHub repo, so that you guys can test the API yourself and let me know how it works. |
||||
|
Thanks @just_in_case for adding some of the core features to the engine, a game controller support is a must in my opinion in a game engine. really appreciate your and sven's work in the community, you two guys are enhancing the engine day by day. |
||||
|
Thanks a lot for your kind words, but everybody in this community is contributing something, they are answering each other's questions, and helping each other with music, arts, and other things. I appreciate everybody's work. |
||||
|
just_in-case wrote: @Gree, unfortunately, no, as these commands are developed for the Windows platform only and will work there, not sure if @niko will implement them to work with other platforms as well. Please update the scripting section of the manual so as not to spend days and weeks programming something that just can't work on the target platform. Section: Windows only ccbCommands Section: WebGL only ccbCommands Section: Apple only ccbCommands Section: Android only ccbCommands |
||||
|
I don't know if you have noticed it or not, but almost every command that doesn't work in the editor or other platform has a NOTE in the manual that this commands only works on windows, and this command only works in the editor and all. But yeah, I do think that there should be an easy way of checking them out, I remember I had created my own version of Javascript documentation for neophytes.cf but never got enough time to work on it. Here is a direct link to the scripting reference on the neophyte.cf it is not complete, but you will get the idea of which commands work on webGL and which on windows, and which in the editor. https://neophyte.cf/cc_js_ref.hm... Most of the command has an icon of the supported platform. |
||||
|
Nice Wish everybody contributes a bit to your manual otherwise its a ton of work. |
||||
|
yeah, it gonna be a lot of work, but I am thinking of adding one code example every sunday, so that it won't hurt and can eventually be progressed. |
||||
|
Added an extra parameter to the Render to Target API, that will hold the node that you want to exclude from rendering on the RTT texture, The best is to create a folder node in scenegraph explorer and then put all the nodes that you want to exclude in that folder, and simply supply that folder to the API command. This is useful for example when you don't want overlays to be rendered to the texture. ccbRenderToTexture(node, material index, camera, X resolution, Y resolution, node to be excluded) However the RTT texture will cause flickering of water nodes, I am still trying to figure out a way to prevent this. If I will be not able to find a fix, I will try to create a custom water shader. Added a few more commands:- ccbGetParentSceneNode()Returns the parent node of a scenenode special attribut type "Id"Returns the Id of a sceneNode ccbRegisterMouseDownEvent() and "behavior.prototype.onMouseEvent"now returns new values as well for DoubleClick and TripleClick for left mouse button ccbGetSceneNodeGravity(node)Returns the gravity of a scene node ccbSetSceneNodeGravity(node,gravity)Sets the gravity of a scenenode. Above per scene node, gravity only works in the inbuilt collision system and doesn't work for the "physics simulation" physics simulation still uses the scene gravity. There needs to be a "Collide when moved" behavior attached to the node. ccbPackTextures(texture1,texture2,"newTextureName")Pack two textures into 1, in a horizontal increase, can be used multiple times to pack multiple textures. ccbRemoveTexture(texture)Removes the provided texture from the memory, won't remove it from the objects that use this texture and can be useful in reloading external textures. Added some sound recording API commands, for many events like start recording, stop recording, save recorded sound to disk and many more |
||||
|
Just_in_case wrote: Added an extra parameter to the Render to Target API, that will hold the node that you want to exclude from rendering on the RTT texture, The best is to create a folder node in scenegraph explorer and then put all the nodes that you want to exclude in that folder, and simply supply that folder to the API command. This is useful for example when you don't want overlays to be rendered to the texture. nice just_in_case will be very useful! |
||||
|
Continuation of previous Thread ccbStartRecordingAudio()Starts recording audio from the mic. ccbStopRecordingAudio()Stop recording the previsoulsy started audio recording. ccbSaveRecordedAudioToDisk("Filename")Saves the recorded audio to disk in .wav format. ccbSaveRecordedAudioToMemory("Filename")Saves the recorded audio to memory and can be later accessed with ccbPlaySound(). It gets clear when the game is closed. ccbRemoveSound("FileName")removes the sound source, useful when removing recorded audio from memory. ccbAddSound("SoundFile", "Alias")Add the sound to the game with the new name assigned to it, can be used to have a single sound file played differently with different sound effects. [b][code] More Sound related API's are still in development. Hope to bring more to the engine. Also modified the per scenenode Gravity, just created a new Gravity attribute for every scene node, so instead of using ccbSetSceneNodeGravity() and ccbGetSceneNodeGravity() one can set or get them directly as attribute using ccbSetSceneNodeProperty() command. |
||||
|
It would be so great to have some basic pitch control. Super useful if you're making an automated fire or car engine sfx. |
||||
|
@okeoke if you have read the very first post, I already had the "Playback speed" parameter for the sound that also controls the pitch, when I was first learning the basic of C++, but that was breaking the sound node, so it didn't make into the update. but as my skills are somewhat improved, I already implemented pitch control and sound effects like Chorus, Reverb, distortion, gargle, flanger, compressor, echo, reverb, and many more. they all are working great, I am just testing out a few things to provide easy usage of the sound effects and other sound-related options. |
||||
|
wrote: Created an Input event API for the controller buttons. ccbRegisterJoyButtonEvent(funcstr) previously I made it to return the button numbers that were pressed down, but now I changed it to return the buttonstate from a bitmask[32]. which means it will allow up to 32 buttons and can be more easily configured with multiple buttons simultaneously pressed. It returns the button state in the power of 2. like [1,2,4,8,16,32,64,128,256,512,1024,2048,4096 and so on] let's say you pressed button 1 and button 3 at the same time then we know that button 1 = 1, and button 3 = 4, as per the above bitmask. So it will sum up the bitmask for button 1 and button 3 which is equal to 5 and will return it. We can then easily use it to check if buttons are pressed in combo and much more. While the button numbers that I was using previously only returned a single button value and didn't allow us to use more buttons at the same time simultaneously. will add axis, pov, and all as input event receivers. Here is a test video showcasing the usage of the controller, it prints the number of buttons that were pressed on the controller in the debug panel, if the number was 1 then it will move the cube ahead on X-axis. 0 means no button was pressed. https://youtu.be/D0VSDiZkqw8 This video was created using the old method, I have updated the code a bit now. let me know what you guys think about the controller support. Edit:- Added POV and Axis input control API ccbActivateJoystick()Activates the controller support for your game. Also returns the Joystick Information like number of buttons, axes, Joystick id, name etc.ccbRegisterJoyButtonEvent(funcstr)return the bitmap mask of the currently pressed buttons.ccbRegisterJoyPovEvent(funcstr)returns Pov value (generally angles)ccbRegisterJoyAxisVerticalEvent(funcstr)returns Axis value vertically -1 for down and +1 for upccbRegisterJoyAxisHorizontalEvent(funcstr)returns Axis value horizontally -1 for left and +1 for rightccbRegisterJoyAxis2VerticalEvent(funcstr)returns second Axis value vertically -1 for down and +1 for upccbRegisterJoyAxis2HorizontalEvent(funcstr)returns second Axis value horizontally -1 for left and +1 for righthashtag.joybuttonpressed.buttonSpecial coppercube variable that returns the button state of the button. I don't have two controllers, so can't check the multiple controller's compatibilities. But the above code works on my controller. Will soon update my GitHub repo, so that you guys can test the API yourself and let me know how it works. You add the POV mouse movement to ccbRegisterJoyAxis2VerticalEvent and ccbRegisterJoyAxis2HorizontalEvent???? May i see a cuppercube file test? |
||||
|
New SoundPlayback system with the API:- ccbPlaySound("SoundFile","Repeat(bool)","SoundType(2D/3D)","SoundProperty","PropertyParameters") Please see the continuity post on the next page |
[ < 3 4 5 6 7 > ] Page 5 of 8 |
|