Skip to content

Commit

Permalink
Initial DGDS Viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
xesf committed Mar 26, 2020
0 parents commit 5e392d2
Show file tree
Hide file tree
Showing 49 changed files with 16,747 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
extends: airbnb
parser: babel-eslint
parserOptions:
allowImportExportEverywhere: true
env:
browser: true
globals:
ga: false
rules:
indent:
- error
- 4
- SwitchCase: 1
FunctionDeclaration:
parameters: first

linebreak-style: off
curly: off
comma-dangle: off
prefer-destructuring: off
default-case: off
function-paren-newline: off
camelcase: off

class-methods-use-this: off

object-curly-spacing: off
object-curly-newline: off

no-console: off
no-throw-literal: off
no-lonely-if: off
no-continue: off
no-bitwise: off
no-param-reassign: off
no-use-before-define: off
no-shadow: warn
no-nested-ternary: off
no-restricted-globals: off
no-restricted-properties: off
no-useless-escape: off

react/jsx-indent:
- error
- 4
react/jsx-indent-props:
- error
- 4
react/jsx-closing-tag-location: off
react/jsx-wrap-multilines: off
react/jsx-tag-spacing: off
react/jsx-filename-extension: off
react/jsx-no-bind: off
react/jsx-curly-newline: off
react/state-in-constructor: off
react/static-property-placement: off
react/jsx-props-no-spreading: off
react/prop-types: off
react/sort-comp: off

import/export: off
import/no-named-as-default: off
import/no-named-as-default-member: off
import/prefer-default-export: off

# Accessibility - disabled for now
jsx-a11y/alt-text: off
jsx-a11y/click-events-have-key-events: off
jsx-a11y/label-has-for: off
jsx-a11y/media-has-caption: off
jsx-a11y/no-autofocus: off
jsx-a11y/no-noninteractive-element-interactions: off
jsx-a11y/no-static-element-interactions: off
jsx-a11y/control-has-associated-label: off
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/data
dist
node_modules
build
server-log.txt
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Alexandre Fontoura

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
85 changes: 85 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# castaway

The aim of this project is to provide a complete re-implemtation of the Johnny Castaway Screen Saver created by Dynamix using Javascript.

![alt text](castaway.png "Dynamix Johnny Castaway Screen Saver")

## Live Demo

[Check here the current development state](http://castaway.xesf.net/#entry=MJFISH.TTM)

## Purpose
- Re-implementation of the Johnny Castaway Screen Saver;

- Learn the Dynamix Game Development System (DGDS);

- Document the files format used;

- Build tools using NodeJS;

- Focus on taking advantage of the modern web development languages and frameworks like Javascript and React;

- Use as a sandbox to try new features of those frameworks during the process;

- Have fun implementing it!!

## Enhancements

List of new features to add to Johnny Castaway experience:
* Day/Night loop in 24h instead of 8h
* Day/Night based on user location sunrise and sunset
* Moving cloulds
* Add waves like the static screen
* Accelarate time
* Tides based on user locations with real time coutry low tide info
* Play Full Story Sequence
* Choose single activities to play
* Number of full complete stories played worldwide
* Total hours worldwide played
* Statistics per Activity
* Total Jogging
* Fishing
* etc.
* Extend festive days from the original - could be based on user location

## Documents

[Resource Index File Format](docs/resindex.md)

## Usage

This project uses node, yarn and lerna CLI to manage multiple applications and packages in a mono repository.

Install:
* nodejs: https://nodejs.org/en/
* yarn: https://yarnpkg.com/en/

Run this commands in the root folder:

> yarn global add lerna
> lerna bootstrap
### Dump Resources

This application allows you to extract the resources of Johnny Castaway. A data/dump folder will be created when application is executed.

> cd projects/dump
> yarn start
### Viewer

This application allows you to browse through the resources and play them.

> cd projects/viewer
> yarn start
### Mobile

A ReactNative experimental application to play Johnny Castaway. At the moment it only executes the viewer as a web view, but in future should play the whole story.

> cd projects/mobile
> yarn start
16 changes: 16 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
presets: [
'@babel/preset-env',
'react-app',
[
'minify',
{
mangle: false,
}
],
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread'
],
};
Binary file added castaway.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions docs/resindex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Resource Index File Format [rev 0.0.1]

Resource Map is a file containing index information about resources.

It allow us to identify which resource files need to be imported and the details of each entry of that resource file.

# Engine
Dynamix Game Development System (DGDS) - an engine originally created by Dynamix based on Sierra pre-existing engine.

## Games
- Johny Castaway Screen Saver
- Quarky & Quaysoo's Turbo Science,
- Heart of China,
- The Adventures of Willy Beamish,
- Rise of the Dragon

# Format

It is composed by:
- Header
- Resource List
- Resource Entries

## Header

The header is static with length of 6 bytes

- u8 unknow0
- u8 unknow1
- u8 unknow2
- u8 unknow3
- u8 numResources
- number of resources files available in this index
- u8 unknow5


## Resource List

For each numResources entries from Header section do the following:

- *u8: name
- List of characters containing name of the resource file
- Static size of 13 characters
- Last byte is always zero to allow string termination
- This will allow to parse and decompress all the resource files used

- u16: numEntries
- Number of entries the resource file has to be imported


## Resource Entry Header

For each numEntries from Resource List do the following:

- u32: length
- Decompressed entry size
- This will help understanding which entries need to be decompressed. More details on the Resource file format documentation

- u32: offest
- Offset of the entry inside the Resource file

Note, to get the size of each of the compressed entries, you just need to calculate the different between the offsets.
- current_offset_size = next_offset - current_offset


At the end of this implementation, you should be ready to parse the Resource files, which will be describe in a separate document file.

# Document History
- v0.0.1 2018-11-09: First document draft

# Author
Alexandre Fontoura aka xesf
- xesfnet@gmail.com
- https://github.com/xesf

## References
- Hans Milling aka nivs1978 (github)
- https://github.com/nivs1978/Johnny-Castaway-Open-Source/blob/master/JCOS/Map.cs

- Vasco Costa aka vcosta (github)
- https://github.com/vcosta/scummvm/wiki
85 changes: 85 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"name": "dgds-viewer",
"version": "0.1.0",
"private": true,
"main": "src/electron/index.js",
"homepage": "./",
"scripts": {
"start": "concurrently \"yarn server\" \"wait-on http://localhost:8585 && electron .\"",
"server": "cross-env NODE_ENV=development nodemon ./src/server/index.js --exec babel-node -w ./src/server/index.js",
"dump": "cross-env NODE_ENV=development nodemon ./src/dump/index.js --exec babel-node -w ./src/dump/index.js",
"lint": "eslint ./src --ext .js,.jsx -c .eslintrc.yml",
"build": "yarn build:server && yarn build:electron",
"build:electron": "electron-builder",
"build:server": "cross-env NODE_ENV=production webpack -p",
"release": "yarn build:server && electron-builder --publish=always"
},
"dependencies": {
"async": "^3.2.0",
"axios": "^0.19.2",
"classnames": "^2.2.6",
"cors": "^2.8.5",
"electron-is-dev": "^1.1.0",
"express": "^4.17.1",
"lodash": "^4.17.15",
"morgan": "^1.10.0",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-redux": "^7.2.0",
"redux": "^4.0.5",
"react-scripts": "^3.4.1",
"semantic-ui-react": "^0.88.2",
"webpack": "^4.42.1",
"webpack-dev-middleware": "^3.7.2"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.0",
"@babel/node": "^7.8.7",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-object-rest-spread": "^7.9.0",
"@babel/polyfill": "^7.8.7",
"@babel/preset-env": "^7.9.0",
"@babel/preset-react": "^7.9.4",
"@babel/register": "^7.9.0",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"babel-preset-minify": "^0.5.1",
"concurrently": "^5.1.0",
"cross-env": "^7.0.2",
"css-loader": "^3.4.2",
"electron": "^8.2.0",
"electron-builder": "^22.4.1",
"electron-chrome-extension": "^5.0.0",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.1.0",
"eslint-loader": "^3.0.3",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^2.5.1",
"eslint-stats": "^1.0.1",
"json-loader": "^0.5.7",
"node-libs-browser": "^2.2.1",
"node-sass": "^4.13.1",
"nodemon": "^2.0.2",
"raw-loader": "^4.0.0",
"sass-loader": "^8.0.2",
"style-loader": "^1.1.3",
"wait-on": "^4.0.1",
"webpack-cli": "^3.3.11"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Binary file added public/assets/favicon.ico
Binary file not shown.
Binary file added public/assets/jonny.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions public/assets/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"short_name": "dgds-viewer",
"name": "Dynamix Game Development System Viewer",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
Loading

0 comments on commit 5e392d2

Please sign in to comment.