Skip to main content

News

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - N E O

46
As we know, JavaScript is primarily a web language. For over a decade Sphere has somehow been able to bend JS to the whims and wills of those developers who choose Sphere as their game engine of choose. Web languages, however, have "advanced" while Sphere remains firmly entrenched in using strictly JS; CSS has Less and SASS to add programmatic capabilities to it, while JavaScript has, among others, CoffeeScript and Dart perform in similar fashions. Both the CSS solutions and the JS solutions aren't interpreted directly by the browser but are instead "transcompiled" (Wikipedia's word) to their original respective languages which CAN be interpreted directly.

All four of the listed language "supersets" have standalone compilers or shim scripts to allow direct embeds into web pages, but of interest to us right now is the JS set. So I pose the question:

If a person wants to write their Sphere-compatible script in a language like CoffeeScript or Dart, should we build in pre-compilation/interpretation/"transcompilation" to JS into Sphere (either the editor, engine, or both) or force those scripts to be converted to JS before inclusion in their projects?

Such functionality also opens the door to discussion of Sphere-compatible engines using non-JavaScript-based languages like Python, Ruby, or Lua for scripting, so I'll open another thread on that. This thread is for discussion of "transcompilation" to JavaScript.
47
Array randomizer, both non-destructive (by copy) and destructive (in-place). It's quite possibly the shortest way to write a shuffle and I can't believe I didn't realize it until now.

Code: (javascript) [Select]

/** non-destructive randomizer **/
function shuffle(arr) {
var r = arr.slice();
return r.sort(function(a,b){
return Math.random()-Math.random();
});
}

Code: (javascript) [Select]

/** destructive randomizer **/
function shuffle(a,b){return Math.random()-Math.random();}
// ... then sort in place ...
someArray.sort(shuffle);


The two Math.random calls are really the only thing stopping it from being as fast as a normal sort function. Array.sort is inherently destructive and I wanted to operate on a copy; you can use the in-place shuffle if you don't need the copy. You can also modify the sort function to use properties of a and b like any other sort function.
48
Projects / Triple Triad JS
Spent the past week or so boning up on Triple Triad, the card game first introduced in Final Fantasy VIII. Searching for already-made Triple Triad games to play, I found a couple of sites mostly using Flash and some no-longer-maintained programs. Suffice it to say the vast majority of these are unplayable. I've wanted to make a Triple Triad clone for a pretty long time that I could actually play. Enter Triple Triad JS!

Rules
For those unfamiliar with Triple Triad, it is a card game with a few basic rules and the innate ability to add a few more rules. It is a two-player duel with a coin flip to determine who starts. Players take turns placing cards into empty cells of a 3*3 grid. The game ends when all 9 cells are filled and the winner is determined by who holds the most cards, including the leftover card in the second player's hand, when the grid is filled.

Cards have 4 values, each corresponding to a compass direction (North, East, South, West). When a card is placed in a cell, its values are checked against the opposite values of cards in neighboring cells; North checks against the North card's South, East checks against the East card's West, etc. If the played card's checked value wins over the adjacent card's value based on the given play rules, the adjacent card flips possession (like Reversi), otherwise no change takes place.

Greater
A played card only wins if its value is greater than the adjacent card's corresponding value. By default this is the only capture rule in effect, but capture rules can be declared to extend win conditions; the Greater rule cannot be removed, however. The original Triple Triad did not name this condition.

Same
If a played card's value is the same as an adjacent card's corresponding value, the adjacent card flips.

Example: played card's North value is 3, adjacent North card's South value is 3, North adjacent card flips.

Same Wall
Similar to Same but also checks against the Wall. The Wall's value is always 10. Same Wall can only be in effect if Same is also in effect and Wall-adjacent cards can only be flipped if their corresponding values are 10.

Plus
If the sum of a played card's value and its adjacent card's corresponding value in one direction is the same as the sum of the played card's value and its adjacent card's corresponding value in another direction, both adjacent cards flip.

Example: played card's North value is 3, adjacent North card's South value is 7 (sum is 10), played card's East value is 4, adjacent East card's West value is 6 (sum is also 10), North and East adjacent cards flip.

Combo
If a card is flipped using Same, Plus, or Same Wall, cards adjacent to it are checked according to all the given capture rules (including Greater), similar to a paint bucket fill in image editors. This chain continues until no more cards can be flipped according to the current rules; one can theoretically win a game by flipping all the cards on the board with their last card if Combo is in effect. Combo is automatically in effect if Same, Same Wall, and/or Plus are in effect.

Elemental
Random cells are assigned random elements. If a card's element is the same as the cell's it receives a +1 boost on all values, otherwise it receives a -1 penalty on all values. The boost does not affect Same, Same Wall, or Plus comparisons in effect.

Open
Both players' hands are visible during the match.

Random
A player's hand is chosen randomly from his or her deck instead of being able to choose manually. This can be accomplished by shuffling the deck and choosing the top five cards or programmatically choosing five random cards.

Sudden Death
If a game ends in a Draw, the match restarts but the players instead start with the cards they captured. Play continues in this manner until a winner is determined.

Trading and Winning
Triple Triad has built-in rules for trading and winning which can be agreed upon before a match starts. They are irrelevant in a local installation of a given Triple Triad game but shall be elaborated upon and expanded once multiplayer features and online deck management are added.

JS Edition Progress
Currently I have successfully implemented Open, Random, Same, and Combo rules. Both players decks are created randomly and hands are chosen randomly and programmatically. The first player is chosen randomly in a simulated coin flip and all nine turns are simulated with a winner or draw determined at the end.

Once I add basic user interaction (choosing hands, choosing cell placement) I'll upload it to the site and provide source code. For now I'm working on the web version of the game while I abstract as much platform-independent stuff as possible (jQuery for web interaction and the game simulation). I also plan on making this an example of using Firebase to manage online Sphere data.

(edit - clarified Combo)
49
Articles / Screen recording Sphere and/or editors
I glossed over this briefly in the Screenshot thread, for those who would like to record their session in one of the Sphere engines or one of the editors, you have a few options available to you:

Wikipedia has a more complete list of video editing programs than presented here for the three major operating systems, and a list of video screen capture programs.

Windows
Free video capture programs include CamStudio, HyperCam, and .kkapture (alternate URL), among others. TechSmith, maker of the commercial Camtasia, also has a free app Jing for capturing as well but is limited to 5 mins at a time (not a problem for the preview video). Another free, open-source capture solution on Windows is the recently released Open Broadcaster Software/OBS.

TechSmith Camtasia Studio is so far the leading commercial video screen capture available and is available on Windows and Mac OS X. Fraps is another commercial capture solution of lower cost than Camtasia but known to be buggier and prone to significantly lowering the performance of the thing it's trying to capture.

Linux
Linux-specific video capture programs include Kazam and SimpleScreenRecorder. A third capture program, RecordMyDesktop, is also available but is reported to have critical bugs that prevent it from being a long-term recording solution.

Linux-specific video editing programs include LiVES, Kdenlive, and Cinelerra ("community version").

Mac OS X
QuickTime Player (possibly QuickTime X) can reportedly perform video capture of the screen. I don't know if it requires a Pro license, however.

TechSmith Camtasia Studio, as mentioned above, is commercial and is available on Window and Mac OS X. Jing also has a Mac OS X version with the same limitations as its Windows counterpart.

Multi-platform
Free cross-platform video editors apparently include Avidemux, Jahshaka/CineFX, the not-yet-stable VLMC, and OpenShot (see below). Nothing specifically Mac is available for free.

Conversion: FFmpeg
If you have nothing else, use FFmpeg (possibly with a GUI front-end like WinFF) to convert to the chosen formats if needed. You may also use FFmpeg for splitting and joining if nothing else is available. FFmpeg is free, open-source, and has Windows, Mac OS X, and Linux versions available. It's primarily command-line, but GUI front-ends are available for each of its systems.

Editing: OpenShot
OpenShot is a video editor and is currently Linux-only, but is expected to go multi-platform when version 2.0 is released by the end of 2013 thanks to a successful Kickstarter. Once OpenShot is finally cross-platform, that will likely be the graphical video editor I recommend from then on.


Improving this list
If you have constructive suggestions to add to this list, please feel free to add a reply!
50
Articles / Theory-based menu system tutorial by me
http://wiki.spheredev.org/Menu_Tutorial_by_NeoLogiX

Inspired by the restoration of a menu system article to the wiki from before, I wrote a theory-based tutorial similar in style to my battle system tutorial on how to create a menu system. Once I find all the existing versions of NMenu again I'll put them up as samples, since the article really is the skeleton theory I used to originally create NMenu.

If you create a menu system using my tutorial as a guide I'd love to see it!
51
I've been working locally on the new forum theme but it's still not yet complete. It's intended to be a total conversion and replace the style and layout of pretty much the entire software.

Should I upload it piecemeal and let y'all test drive it or should I wait until it's complete before putting it up for use?
52
http://daux.io/ is a Doxygen-like documentation generation software that is geared towards simpler doc structure and the use of Markdown for the syntax. It's free and on GitHub.

While the wiki is nicely editable and its syntax is simple enough if needed, should we consider having Sphere's documentation downloadable and in a format such as that daux.io generates? Obviously we'd need to update the docs first if that's the case.
53
Article on the wiki: http://wiki.spheredev.org/Developing_a_Sphere-compatible_engine

This is a work-in-progress that I started with the intent of unifying as much reliable information as possible regarding the advancement of the Sphere Game Engine and development of other Sphere-compatible game engines.

Key points to consider:

  • API compatibility - Sphere uses JavaScript and has quite a bit of custom functionality written into it; this API is primarily what makes Sphere Sphere.
  • Handle input consistently - keyboard, mouse, joystick; those are the most common inputs a Sphere-compatible engine should be able to handle. Anything beyond is gravy but if it works please consider recommending it for inclusion in vanilla Sphere's input handling ;)
  • Handle output consistently - video: windowed and full-screen, hardware-accelerated and software-rendered; audio: as close to the sound of the original program that created it as possible.
  • Handle formats consistently - Sphere loads custom bitmap fonts, window frames, spritesets, maps, and tilesets, among other formats; the resulting output should look and act the same across all engines and platforms.
  • Handle everything reliably


Currently if you're not designated as a wiki editor and doing cleanup edits to it I'd much rather you leave the page alone unless you're one of the following users:

  • Flying Jester
  • Radnen
  • casiotone
  • metallix
  • Eggbert


If you choose to contribute to one of the existing engine projects or make your own let us know and I'll add you to the list and encourage you to document things of significance in the article as well.
54
Sphere 1.5/1.6b: thread

TurboSphere: thread

minisphere: thread

unnamed Sphere clone in SDL: thread

sphere-sfml: thread

Sphere Web Edition: thread

(edit: added minisphere +neo)
55
Editor Development / Sphere IDE
57
Engine Development / Sphere - Web Edition
The official thread for Sphere - Web Edition.

Repository: https://github.com/sphere-group/web-sphere

For utilities written in JavaScript, visit the Sphere Web Utilities repo.

For casiotone's implementation of the Sphere API in JavaScript, visit this thread.

Sphere - Web Edition has a pixi.js branch and a three.js branch. Possible future implementations may include a Turbulenz branch.
58
Sphere General / Sphere Web Utilities
Inspired by Radnen's originally failed attempt at loading a windowstyle on the web, I finally started my JS-based Sphere-format file loading for previewing.



Let me know if you want commit access to the repo. Since the demo HTML file uses jQuery's AJAX to get the file it's subject to cross-domain limits, so if you want to run it locally you'll probably need a local webserver. Once done, I'm going to likely do a pull request on casiotone's project once I edit the loading code to his style.

Still tweaking positioning for windowstyle elements in the div since it's dynamic, otherwise successfully loads all 9 basic pieces; will probably convert it to a "hover-over-piece to display" workflow instead. RWS.drawWindow implemented!

RFN loading will be next! RFN loading done, RFN.drawText implemented!

RSS spriteset next! RSS loading done, spriteset animation done!

RTS tileset next! RTS loading done, tileset animation done!

RMP map next! RMP loading kinda done, display is next!
59
Site Comments / Sphere vector icon
I've recreated Dom's Sphere icon in vector format and uploaded it to the wiki.

http://wiki.spheredev.org/File:Sphere.svg

Since I don't currently have access to the vector version of the Sphere icon I modified to have thinner lines and subtle color gradients for higher resolution use, I'll probably recreate that too.
60
I've long extolled the virtues of using Scenario for scriptable cutscenes and use a modified version of it in my NShoot demo Artyxx. The main modifications were mostly to hook it up to the various wrappers and such I use in its code and the version I modified is either a later v1 or an early v2; the mod refers to it as NQueue for those who are so inclined to look for it in the source and also adds the ability to load command presets from slightly broken JSON files (the breaker is the addition of function objects that vanilla JSON doesn't support).

Updating the code to a more recent version of Scenario:

1. Are there any major breaking changes I should be aware of between the old version and 3.6?

2. Should I hold off on updating until the eventual v4 or will there be more breaking changes?

I would still be modifying it to fit NShoot and be able to load preset files, but otherwise I'd keep it pretty much intact (I may have to rework the render/update loop depending).