Page 1 of 1

[Game] Basic framework for any Cock Hero game

Posted: Sun Apr 21, 2019 6:57 am
by tmp_pmt
Some time ago I created Javascript framework for Cock Hero (CH) games. In short, here is how it works...

Imagine game with lot of CH rounds, easily configurable to add new rounds, so game can have tens or even hundreds of them. It streams clips from public sites like xHamster, that allow to embed video and start it from specific time. As videos are not included in build, game size remains small. Framework maintains database of clips in configuration file as well as database of music clips along with beatmeter data (from Beatmeter Generator by kerkersklave). In short, it adds visual beatmeter to any video.
Video and music clips in database have tags (defined by game creator) and can be queried like: "get clip with blonde in forrest"
Beside this, there is more features like alternate beatmeter data for the same song (difficulty levels), support for speech synthesis, text output, cutting part of music (and optionally repeating it), etc.

Below is link to demo. It is not full game, it simply lets you to play with small database of clips it has. Package also contains detailed manual with two parts: User experience (how to use demo) and Technical details with description on all features and how it works.

https://mega.nz/#!Ig8XVCTA!E2lwJ2VrO9FI ... 3n-Lut78nU

It is HTML/Web app so you need server. Either put it on server or run it from local server (I think Firefox can directly run index.html). This is another advantage. Games made with it can be put on web or played locally (from local server).
It is basic framework for rendering beatmeter, maintaining databases of clips, etc. It is not any game editor. I believe, that other game engines/frameworks can be easily connected to it to use it - I see it suitable for games like the ones made by mortimer - it would shrink download size to minimum and allow to use many clips to prevent repeating.
It also opens opportunities for collaboration. Some people can build game, while other can prepare music and beatmeters in Beatmeter Generator independently.

Re: [Game] Basic framework for any Cock Hero game

Posted: Sun Apr 21, 2019 10:53 am
by doremi
A little complex but interesting! I'm always surprised with how much can be done with JavaScript. I'll check it out later.

Re: [Game] Basic framework for any Cock Hero game

Posted: Sun Apr 21, 2019 1:18 pm
by hj9k1
Interesting parallel to sites like https://fapinstructor.com/ (which is conceptually similar, just not CH per se; maybe there is inspiration to be had?), will have to check it out!

Re: [Game] Basic framework for any Cock Hero game

Posted: Sun Apr 21, 2019 2:02 pm
by pl3b
Interesting approach, never thought of doing that through a browser. Curious to see how it works.

Re: [Game] Basic framework for any Cock Hero game

Posted: Mon Apr 22, 2019 6:17 am
by tmp_pmt
44some wrote: Sun Apr 21, 2019 10:44 pm How about making it so it can pull video clips right off your own PC? I bet many of us have a considerable collection. It would be especially helpful if it can play a clip at a certain time point...play from 18:00 to 18:30, since many vids have 15 minutes of filler before any action. Local clips will be faster, and likely better resolution.
First, it is not final game, just demo. Instead of game, there is only screen with database selections. But, what you want is possible (as it is web app, it has to run from server - either standard or local on your PC.):

1. find file assets/video/defs/SiteDefs.json and add this new object:

Code: Select all

    "local": {
        "displayName": "Local",
        "url": "assets/videoclips",
        "allowsHD": true,
        "timeSeekUrlAppend": "#t=",
        "timeFormat": "integer"
    },
It defines new site for clips named "Local" and its path is just relative to index.html

2. create folder "videoclips" in folder assets
3. put some video clip inside. In my test I put there "Melisa_Mendini.mp4"
4. go to assets/video/defs/VideoClipDefs.json and add clip definition:

Code: Select all

        {
            "clipId": "Mellisa Mendini",
            "siteId": "local",
            "url": "assets/videoclips/Melisa_Mendini.mp4",
            "description": "",
            "startTime": 155,
            "endTime": 215,
            "starName": "Melisa Mendini",
            "category1": "Room",
            "category2": "Brunette",
            "category3": "Solo",
            "category4": null,
            "requestedMusicLength": ["full"],
            "timesPlayed": 0
        }
(for testing, you can delete all other previous clips, so you will have only one clip in database). Important is to enter correct "url", "startTime" and "endTime" (both in seconds). Categories are categories that specific game (in our case only demo) defined and understand.
5. run index.html and play clip ... it works!

If you are not experienced in code editing, be careful to not screw commas, parentheses, etc. I also recommend to read documentation in original package for details on features.

From above, you can see, that if someone makes game with the framework, it is then easy to add new clips or even completely change clips database! You will have the same game, but with different clips. In the same way you can change music. Music + beatmeter can be created (in Beatmeter Generator) by people who do not know how to code and uploaded somewhere like: "hey I made beats for music X, get .mp3 + .json here and use it for your game."

Re: [Game] Basic framework for any Cock Hero game

Posted: Mon Apr 22, 2019 9:55 pm
by fragrantEmulsion
This is really intriguing and I will probably play with it sometime.