Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Sep 10, 2014
1 parent 03fbde0 commit 0f494eb
Show file tree
Hide file tree
Showing 4 changed files with 223 additions and 32 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ HappyFunTimes
* [Example Descriptions](docs/examples.md)
* [Setting Up for Party or Installation](docs/network.md)
* [Notes](#notes)
* [Migrating from 0.x.x to 1.x.x](docs/migration.md#migrate-from-0xx-to-1xx)

[![Build Status](https://travis-ci.org/greggman/HappyFunTimes.svg?branch=master)](https://travis-ci.org/greggman/HappyFunTimes)

Expand Down
2 changes: 1 addition & 1 deletion docs/makinggames.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Making games with HappyFunTimes
* **[Games in JavaScript](#making-a-game)**
* **[game.js](#game-js)**
* **[Handling Players](#handling-players)**
* **[package.json](#package.json)**
* **[package.json](#packagejson)**
* **[Required Fields](#required-fields)**
* **[Other Languages](#other-languages)**
* **[hft commands](#hft-commands)**
Expand Down
194 changes: 194 additions & 0 deletions docs/migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
Migrating Older Games
=====================

* [Migrating from 0.x.x to 1.x.x](#migrate-from-0xx-to-1xx)

## Migrating from 0.x.x to 1.x.x

I'm really sorry but to separate the games and turn happyfuntimes into a kind
of virtual console required some non-backward compatible changes. I'll do my
best not to break things in the future.

If you made a game for HappyFunTimes before they were separated from HappyFunTimes
here are some of the steps you need to take.

* First, [install happyfuntimes](http://superhappyfuntimes.net/install) and run it at least once.

* copy everything to a new folder outside of happyfuntimes

pre version 1 all games existed side happyfuntimes in `public/examples/gameid` or
`public/games/gameid`. Now they should be completely outside of happyfuntimes
in their own folder

* add a `.gitignore` file. Copy one from one of the examples. Ideally of the same type
so for example if it's a unity game [use this one](https://github.com/greggman/hft-unitycharacterexample/blob/master/.gitignore).
If it's an html5 game [try this one](https://github.com/greggman/hft-boomboom/blob/master/.gitignore).

* inside that the folder type `.git init`

* edit `package.json'

[It should only have these fields](makinggames.md#packagejson).
Delete any others and edit appropriately

* if you were using audio in HTML5 or TDL from one of the previous samples [copy a bower.json file](https://github.com/greggman/hft-jumpjump/blob/master/bower.json)

* edit bower.json

"name"
"deps"
private: true // this is not itself a bower package

* run `bower install`

* Make an icon.png/jpg/gif (64x64 or 128x128)

* Make a screenshot.jpg/png/gif (640x480)

* delete `gameview.html` and `index.html`

Note: in the past there was a script, `build.py` that copied the contents of `game.html` into
`gameview.html` and `controller.html` into `index.html`. These operation now happen at runtime.

But, because the old process was manual many people edited `index.html` and `gameview.html`
by hand so before you delete them make sure you copy the relavent changes into `game.html`
and `controller.html`

* if you had a script before like `mygame.js` or `mycontroller.js` they must be specifically
called `scripts/game.js` and `scripts/controller.js`. They will get included automatically
so don't add any `<script>` tags for them in the files above.

* in all your .js files there was a `requirejs` or `define` function call that listed
other files to include.

define(['../../../somefile`])

requirejs(['../../../someotherfile])

Any path that started with `../../../scripts` should now be `hft` In other words search and replace
`../../../scripts` with `hft`.

Any path that started with `../../../3rdparty/tdl` should now be `../bower_components/tdl/tdl`

Any path that started with `../../scripts` should now be `../bower_components/hft-utils/dist`

Any reference to `imageprocess` is now `imageutils`

tersely

'../../../3rdparty/tdl/???' -> '../bower_components/tdl/tdl/???'
'../../../scripts' -> 'hft'
'../../scripts' -> '../bower_components/hft-utils/dist'
imageprocess' -> 'imageutils/

* Edit your `game.js` and where you make `GameServer` don't pass in anything anymore.

old

g_server = new GameServer({gameId: "someidformygame"});

new

g_server = new GameServer();

* Edit your `controller.js` and where you make `GameClient` don't pass in anything

old

g_client = new GameClient({gameId: "someidformygame"});

new

g_client = new GameClient();

* For a unity game (close unity)

* Move all the files from your project to game folder. It should end up like this

Assets
ProjectSettings
Temp
controller.html
icon.png
screenshot.png
Library
README.md
css
package.json
scripts

* Delete `Assets/Plugins/HappyFunTimes` and `Assets/Plugin/HappyFunTimesExtra`

* Copy the [HappyFunTimes plugin .dlls](https://github.com/greggman/hft-unity3d/releases/download/v0.0.2/HappyFunTimes-Unity3D-Plugin.zip) in to `Assets/Plugins`

* Don't set the gameId nor the controllerUrl in your spanwer

UnityScript

old

function Start () {
var options : HappyFunTimes.GameServer.Options = new HappyFunTimes.GameServer.Options();
options.gameId = "unitycharacterexample";
options.controllerUrl = "http://localhost:8080/examples/unitycharacterexample/index.html";
m_server = new HappyFunTimes.GameServer(options, gameObject);
...
}

new

function Start () {
var options : HappyFunTimes.GameServer.Options = new HappyFunTimes.GameServer.Options();
m_server = new HappyFunTimes.GameServer(options, gameObject);
...
}

C#

old

void Start () {
GameServer.Options options = new GameServer.Options();
options.gameId = "simple";
options.controllerUrl = "http://localhost:8080/examples/simple/index.html";
m_server = new GameServer(options, gameObject);
m_server.Init();
...
}

new

void Start () {
GameServer.Options options = new GameServer.Options();
m_server = new GameServer(options, gameObject);
m_server.Init();
...
}

* Alternatively you don't need your own spawner anymore. There's a generic one in
in the new HappyFunTimes plugin dlls you just installed. More [docs on how to use it
here](https://github.com/greggman/HappyFunTimes/blob/master/docs/unitydocs.md#spawning-player-gameobjects).

* type `hft check`

it should say things look ok

* type `hft add`

This should add your game to your local happyfuntimes installation

* Test it.

Run the new happyfuntimes and see if your game works

* make a repo on github

* execute these git commands (of course replease `<githubname>` and `<reponame>`)

git add . --all
git remote add origin [email protected]:<githubname>/<reponame>.git
git push -u origin master

If you can't get it to commit it github and send me a link. I'll try to fork it, fix it, and submit a pull request.


58 changes: 27 additions & 31 deletions todo.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
To Do
=====

After First Release
-------------------

* document unity3d
* document hft cmds
* genreate min/concat version of hft libs. Allow you to select that style in package.json

so no requirejs

* make hft init make a folder, ask the gametype etc.?
* make HFT start with a overlay that explains how to play "users must be on same net, go to hft.net"

* add option to hide it? ([x] show help on startup)

* publish unity plugin
* figure out why unitycharacterexample is not exiting when hft asks it to.
* make hft.net fail if there's no matching IP

right now it falls back to the first impl which as to scan. But scanning takes
Expand All @@ -28,6 +20,11 @@ After First Release
> are you sure you're on the same network? Connect your phone to the
> same network and click "try again". help.
* genreate min/concat version of hft libs. Allow you to select that style in package.json

so no requirejs

* make hft newgame make a folder, ask the gametype etc.?
* fix names in powpow?
* make code send API version

Expand All @@ -41,13 +38,18 @@ After First Release
to work. But, while developing you might forget? I guess it should at
least print a warning

* make shft tell you you need to upgrade hft
* Add 'what is this' to hft.net
* Add a support field, default to github issues
* make hft-exe write over old version? Should ask? --force?
* check that first installed game works
* when the last page disconnects from __hft__ shutdown?
* add purge request to manage gamedb for icon and screenshots
* fix shft update-exe so username:password works
* make --export for make-release the default
* Add repo link to game screen on shft
* if --dns
* require port 80, fail if we can't get it
* print 'need sudo' or figure out how to ask for permission
* show "setting up ... animated screen" because it takes time for /etc/resolve
* write unity docs
* UnityScript
* C#
Expand All @@ -56,7 +58,6 @@ After First Release
* Git
* Publish
* Test on Windows
* publish unity plugin
* support 2 factor for publish
* publish
* update-exe
Expand Down Expand Up @@ -100,9 +101,6 @@ After First Release
If nothing else there are common things like handling disconnect, reconnect, and maybe
handling quit as well as providing a common frame.

* make shft tell you you need to upgrade hft
* Add 'what is this' to hft.net
* Add a support field, default to github issues
* Figure out if it's possible to make HFT.net work on more networks

HFT.net currently requires NAT based networks like home routers.
Expand All @@ -116,15 +114,7 @@ After First Release

* make install screen only show your OS. Link to "other versions"
* Add phantomjs based tests
* Make game check for valid HFT (I don't remember what this means)
* do hft add
* do hft install


* if --dns
* require port 80, fail if we can't get it
* print 'need sudo' or figure out how to ask for permission
* show "setting up ... animated screen" because it takes time for /etc/resolve
* make a test game for unit tests
* when listing mulitple HFTs running behind the same public IP address include
username and machine name?

Expand All @@ -142,20 +132,15 @@ After First Release
* Have browser check if it's the default for hft. If not suggest to make it the default for hft.
* add option the choose browser to launch?
* Add options to HFT
* Figure out how to get HFT on start screen
* make hft-exe update Info.plist version from hft version?
* Optionally allow games to advertize they are running.
* Optionally allow games to advertise they are running.

Superhappyfuntimes can show games in your area. Think

15 people playing jumpjump at Joe's Bar in Maintown, MA
17 people playing shootshoot at Big Burger in Anywhere, USA
etc..

* Need to make installer for hft
* Windows
* Mac
O Linux
* how to migrate old happy fun times

* copy to other folder
Expand Down Expand Up @@ -755,6 +740,17 @@ Runs Repo noid
Done
====

* Need to make installer for hft
* Windows
* Mac
O Linux
* Add repo link to game screen on shft
* when the last page disconnects from __hft__ shutdown?

I'm worried there are times when no game is connected. Also during dev

* document unity3d
* document hft cmds
* make publish upload package.info. Use that one in manage
* Check publising works.

Expand Down

0 comments on commit 0f494eb

Please sign in to comment.