Difference between revisions of "JavaScript"

From RogueBasin
Jump to navigation Jump to search
(Added Saege to the list of Roguelikes in Javascript)
Line 39: Line 39:
* [[Cave of Epokothar]] (HTML5 and Canvas)
* [[Cave of Epokothar]] (HTML5 and Canvas)
* [[Ruins of Kal Raman]] (HTML5 and Canvas) {{7DRL}}
* [[Ruins of Kal Raman]] (HTML5 and Canvas) {{7DRL}}
* [[Saege]] (not yet released)
[[Category:Programming languages]]
[[Category:Programming languages]]

Revision as of 20:27, 25 March 2012

JavaScript is a scripting language used by most web-browsers. Roguelikes can also use it as a scripting language (e.g. for scripted events or quests). This allows changing game behavior without recompiling. Some browser-based roguelikes are written in Javascript or its Microsoft relative JScript (and JScript.NET).

Development Hints

  • Use jsLint[1] to avoid many mistakes that are normally caught by a compiler
  • Javascript frameworks abstract many of the browser inconsistencies. (MooTools[2], JQuery[3])
  • Take advantage of Firebug for Firefox, the Web Inspector for Chrome and Safari and the Developer Tools in Internet Explorer (version 8 and above)
  • Full IDEs are available including Microsoft Visual Studio Web Developer Express, Aptana and NetBeans.

Advantages

  • Scripting languages usually have a faster feedback loop between development and viewing the changes
  • Closures are a powerful language construct that can simplify application structure and enhance readability
  • Any user with a modern browser (on any platform) can run your game
  • A whole new world of easy-to-access graphical possibilities with the DOM or <canvas>
  • Working in a dynamic and garbage collected language takes a lot of the pain out of strong typing and memory management
  • Well supported serialization of data structures using JSON
  • Emerging HTML5 standards provide support for local storage of data
  • Emerging web application stores, such as the Google Chrome Store, provide a distribution platform

Disadvantages

  • Many errors that are caught at compile-time in a strongly typed language will be caught at run-time
  • Existing source for most roguelikes is in C or C++, and not all idioms translate into javascript
  • There are browser differences in javascript implementations and javascript speed, so true portability still takes work
  • Javascript is much slower than C and C++ (however, not all roguelikes require blazing speed)
  • Full filesystem access requires additional plugins


Roguelikes in Javascript

{{{name}}}
Alpha Project
Developer {{{developer}}}
Theme {{{theme}}}
Influences {{{influences}}}
Released {{{released}}}
Updated {{{updated}}}
Licensing {{{licensing}}}
P. Language {{{language}}}
Platforms {{{platforms}}}
Interface {{{interface}}}
Game Length {{{length}}}
[{{{site}}} Official site of {{{name}}}]


BrogueMCP is my personal experimental project to enhance Brogue with AI-driven narrative elements. I'm not a game developer by trade - I'm actually a robotics entrepreneur with ADHD who's using this as a learning tool.

About Me and This Project

I'm a robotics entrepreneur from Nebraska who grew up in the 90s tinkering with computers between riding dirt bikes and climbing trees. Started playing AOEII on my dad's old accounting computer, later got into map modding. Studied Agricultural Economics at University of Nebraska-Lincoln, but ended up building robotic systems for manufacturers.

This project isn't a commercial game but a weekend hobby that helps me build development tools and learn. I'm a devout Christian and a father of three daughters, and I'm sharing this work because I think it could become something interesting.

Initially, I was too ambitious - I started parsing LOTR lore to build a comprehensive storytelling database. But after watching Brian Walker's lectures on YouTube, I pivoted to focus on enhancing Brogue's storytelling while respecting his brilliant original design.

Description

BrogueMCP connects Brogue with Ollama's local LLM to generate narrative descriptions during gameplay. The system remembers your encounters and discoveries to create a coherent story throughout your dungeon crawling experience.

I've implemented a narrator personality system that lets you customize how the game describes events. Press 'N' during gameplay to choose presets like Gandalf, Galadriel, or Aragorn, or adjust specific attributes to create your own unique narrator style.

Features

  • AI-enhanced storytelling that responds to gameplay events
  • Memory system that remembers your journey for contextual descriptions
  • Customizable narrator with adjustable personality attributes:
    • Core attributes (voice tone, wisdom level, verbosity)
    • Thematic tendencies (nature references, metaphor complexity)
    • Speech patterns (sentence complexity, archaic language)
  • Same great Brogue gameplay you already know and love

Technical Details

My implementation uses C for the game core with Node.js for the Dungeon Master agent server. Everything runs locally using Ollama with the llama3 model, so there's no cloud dependency.

The architecture follows this pattern:

[BrogueMCP Game] <--> [MCP Interface Layer] <--> [MCP Server] <--> [Agent(s)]

I've worked to implement proper error handling, memory management, and security validation to keep everything running smoothly.

Current Status

αlpha

This is very much a work in progress! I'm currently cleaning up my cursor rules to better separate my Brogue code from my other experiments. I'm working through compilation errors in MINGW64 and trying to get the game running so I can see if my menu is showing up properly.

Download

Feedback Welcome

As a kinesthetic learner who has to "do" to understand, I'd appreciate any guidance from more experienced developers. I'm happy to pass the torch to someone who wants to take this further. Feel free to reach out with questions or suggestions about what narrative elements you'd like to see in the game! ```