Jump to content

Alan

Members
  • Content Count

    129
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by Alan

  1. Alan

    The Marketplace

    Well modules must be openly named, I see no need to restrict people to use *my* naming convention; to a certain extent the same holds true for the namespace. Yes, I suspect modules will need to *extend* an AbstractBaseModule as this will provide them with the necessary facilities (ie access to core services, the render engine etc). As for registration, I'm thinking something along the lines of a JSON registration file which contains a relative link to the module's routes.php file as well as pointers to any schema change. This would mean that for the system to work I only need load the module's routes.php file during initialisation. Thereafter; only if any of the module's components are need it will be autoloaded.
  2. Alan

    The Marketplace

    Bit of a mix; I'm using a micro-framework; and adding the elements I need to it: DI, logging, database, image processing etc. It means that the core is very light so problems can be diagnosed more quickly as there is less code to have to hunt through.
  3. Alan

    The Marketplace

    Well that is the general idea - what I'm doing is making a very small core "engine", linked to a marketplace that permits developers to upload modules and optionally set prices. The core engine would be free as would a number of the modules on the marketplace.Initially of course, it will be only my own modules however once I've fully designed the core components, I'll open-source it and see if we can get other developers in to help make some of the modules.
  4. Alan

    The Marketplace

    Had a thought last night about using composer as the plugin system -- it's an oddity, but actually it makes a lot of sense in that you are not duplicating code; however I'm a) not sue how to create a "project" for composer, and b) how it would handle things like registration of routes, templates, functions etc. ... Obviously going to have to have another play. Anybody had any experience in this line?
  5. Alan

    The Marketplace

    The plugin system seems to be a winner - there's a couple of caveats that I'm unsure about; specifically I'm having to use reflection to determine the module's identity, and thus path in order to extend the template paths -- not sure how that will work in an "under load" environment; though it could be replaced with the same type of mechanism I use for auto-loading of custom modules. Routing also looks suspiciously or rather potentially slow (currently using a glob), I suspect that can easily be replaced with a simple custom composer script. Next stage is to grant plugins the ability to request alterations to the database structure; this will allow things like the addition of attributes on the player record. The template system is such that while there are a core set of templates; each module will normally extend those to suit. Of course, you are free to override *any* template and in fact you will need to make minor changes to templates when you add certain modules; (ie - positioning links to modules exactly where you want them).
  6. Alan

    The Marketplace

    Well, with the apparent lack of action on games here - I've decided it may be time to create my own. It's a tricky thing creating a new game; as it has to cater for so many different needs; so my first port is a marketplace for modules and templates that can be easily pulled into the game complete with dependencies. The image below is representative of the current work so far. (N.B. module names, brief descriptions, icons, prices and stars are all for my own testing). The core game itself is a while off completion yet - getting it to work with the complexity of the plugins system is causing some interesting headaches, but it looks very possible. Once I've got the core working with a basic set of mods - some of which will be dependant on others like the casino games - I need to design a number of templates which may be a task suitable for some of the peeps here - its primarily Bootstrap 4 based with modules having their own specific overrides, graphics, even typefaces etc. Nothing too fancy, but it allows for fantastic customisation. Anyway, enough rambling ... here's a quick preview of the Marketplace home page (or at least the top part of it!). Oh and before anybody points it out - yes I'm aware I forgot to correctly name the slots module!
  7. Think of it like British Rail -- always late That being said - there are other projects that are being released; you need only look around.
  8. Alan

    Orginal gRPG

    It's sad to see such poor quality of code in this day and age. A quick look reveals a vast number of inconsistencies, suspect design concepts and downright dangerous code. imo this should not have been published as it harms both the owners and potentially the community in suggesting that code like this is acceptable. Saying all that, it is not beyond the realms of possibility to revamp the code; to create something that is at least consistent with itself, however the process takes potentially more effort than the project is worth. For any budding grpg authors you may be better advised using a different code base or designing your own from scratch. Again, while perhaps critical, I'm actually glad to see that people are publishing code; as only be reading, modifying and updating code do we in turn become better at the craft.
  9. Probably Deus Ex. It was ahead of its time in giving the player the illusion of choice - although, a close second is Dungeon Siege; the spiders gave me nightmares; even now - you hear that chittering noise from something and start looking around as your heart rate climbs. Scary stuff.
  10. Alan

    Editor

    Potentially you could use something like TinyFileManager although SSH/(S)FTP is going to be a better solution.
  11. As one who has done similar though not quite so spectacularly I see no need to apologise; we all have different persona's from time to time that we sit behind, now and again they need to be changed to address changing circumstances.
  12. Bolton ... I went there once; it was closed. 😄
  13. Alan

    Plugin System

    That's quite a decent package - Might need to compare that to a feature-flags library. Good shout.
  14. Alan

    Plugin System

    Has anybody come across a stable (packagist based ideally, though native git would suffice) generic plugin system for PHP that permits things like hooks - so database migrations could be run? I'm not looking for anything framework specific - ie Laravel, as while it may be a good choice for some people, there are too many restrictions for my tastes.
  15. Alan

    Text Based RPG Gaming

    Why different? It is easy to come up with a base-line product; making it flexible is the key and how many people are now working in and around the programming industry that cut their teeth with projects like V1/V2 McCodes. Yes, it was a flawed product, and lazy devs didn't bother to change the look and feel much or get mods which fitted their genre, however there are plenty of us who ran/run successful projects based albeit loosely on those venerable code-bases. Take for example a new install of V2. It takes around 3-4 hours to "skin" it nicely and fix some of the more obvious fubars; switch over to a decent DB backend and address some of the interesting database issues. Securing it properly and addressing the more esoteric bugs takes a little time, as does finding some high-quality mods but they do exists - and some of us (myself included) still write the occasional one. Laziness does come into it I agree, however taking a little time to plan before jumping in feet first - and to ensure you have adequate tests and logging in place pays dividends quite quickly. Maybe if people here collaborated a little more - something that did happen 5/6 years ago, then more groundwork could be laid for better projects. So, Yes, as a community it would be good to develop something together, but different - why not stick to something that people can get to grips with and have a wealth of experienced people to discuss their issues/ideas with. [Append] In fact - all that is really needed is a solid foundation, ideally with replaceable code components; authentication, database abstraction, dependency injection, some form of sane plugin system, and let people grow the system from there - you would need to have some form of database manipulation system in place which becomes a little tricky of you consider multiple/mixed back-ends (MySQL,Mongo/PostgreSQL,CouchDB,Redis etc) however those things have been solved in other environments. Dropping the reliance on a specific framework is trickier - I'd be open for pointers on that one; though I suspect relying on PSR7/17 techniques my be the solution to that one.
  16. My learned friend above is quite right; using PHP Storm can be a lifesaver in reducing the number of bugs reaching production; although I'd still point out that testing is ultimately key as many errors have been seen that escape Storm's otherwise beady eye. Test, test and test again. Use PHPUnit for writing tests; use Xdebug for profiling your application; between the two you can produce test coverage in excess of 100% which makes future modifications, upgrades, additions etc a lot safer.
  17. unexpected { or ; are pretty much game over as far as PHP is concerned and while logs help, packages have limited use here as syntax errors often prevent them from operating. I would suggest that any changes where you may be unsure you test locally. Assuming your local system works ... (you are testing aren't you?) ... then there should not be a problem - negating minor version differences in OS/PHP version etc. Next is to run your files through php -l: find . -iname "*php" -exec php -l {} \; this will point any any syntax errors in your code along with a handy line number that suggests where the problem is. You can also run this on a file-by-file basis with php -l <filename>.php If you are using git, it is possible to add this as a pre-commit hook which can save a few headaches.
  18. Alan

    Text Based RPG Gaming

    ... Ah, you've met the wife then 😄
  19. Alan

    Mysql Shim

    As much as I dislike the actual code here - I'm with Ian on this one - it's perfectly acceptable to run shims for considerable lengths of time - quite possibly project lifetime - to address issues of legacy code; unusual libraries etc. Those familiar with the Design Patterns book will note that are a number of patterns which can be considered shim's in their own right -- adapter, facade and proxy if memory serves me. Have a look in your vendor folder(s) ... I'll pretty much bet you'll find at least one instance of these though perhaps named differently in any current project.
  20. Alan

    MySQL JSON field type

    We have ~ 20,000 records per day of API data that needs stored - might be handy in a JSON field; while we don't specifically need to query data within it as I pre-process the data and simply cache it in long text fields; it ~may~ prove useful for future proofing. Saying that, it could be compressed; even a simple LZ compression would yield good results so a blob field possibly with a dynamically created JSON field may suffice.
  21. Alan

    MySQL JSON field type

    Oddly enough, I never considered storing API response data in a JSON field ... makes a lot of sense considering the work we do. Might have to investigate that.
  22. Any have any experience of this ? I have been experimenting with it and while it looks promising, I wonder if there are downsides that I've not encountered yet. For example; this is capable of regenerating to microsecond accuracy player attributes (energy, brave, health, will etc) stored in key-value form with a JSON definition field for each attribute. UPDATE `player_attribute` pa LEFT JOIN `attribute` a ON pa.`attribute_id` = a.`id` LEFT JOIN `player` p ON pa.`player_id` = p.`id` SET pa.`fval` = GREATEST( a.`definition`->"$.minimum", LEAST( pa.`fval` + (a.`definition`->"$.rate_per_hour" * (UNIX_TIMESTAMP(NOW(6)) - UNIX_TIMESTAMP(p.`regenerated`))) / 3600.0, a.`definition`->"$.maximum" ), p.`regenerated` = NOW(6) ) WHERE pa.`player_id` = :player_id AND a.`definition`->"$.type" = "fval" AND a.`definition`->"$.rate_per_hour" IS NOT NULL;
  23. Alan

    MakeWebGames engine?

    Slim doesn't use Whoops - that was simply an addition so that I could debug the code locally - and for whatever reason clearly my username exists validator is wonky! Mixed content - odd, never noticed that on testing; that will teach me for trying to rush something out the door. For those that cba to create an account; you can login with makewebgames/makewebgames. As for big code-bases and caching; yes, you can get decent speeds out of them, however my point was not about speed, but more about reducing the potential complexity of the code. I have multiple applications in the 4-6 million line mark all run sweetly, however with reduced frameworks, the reliance on 3rd party code is reduced (look at Node's problems with ZeroPad for example) and certainly makes for easier debugging since I'm not having to single-step through so much library code - and as can be see from above; even professional programmers make mistakes.
×
×
  • Create New...