Integration of DataTables with HTML5 games – display high scores, leaderboards

Integration of DataTables with HTML5 games – display high scores, leaderboards

samsuk63samsuk63 Posts: 1Questions: 0Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem: Hi all,

I’ve been testing how to show HTML5 game scores using DataTables. The idea: player finishes a game → score goes to server → DataTables fetches JSON and shows a sortable, searchable leaderboard.

Works fine for small sets, but with thousands of rows it slows down. Server-side processing helps, though it means extra work for sorting, filtering, and pagination on the backend. Biggest challenges so far: handling cheating, making tables mobile-friendly, and keeping updates fast.

Has anyone here built something similar? Any tips for large leaderboards or keeping things responsive?

Replies

  • allanallan Posts: 65,339Questions: 1Answers: 10,838 Site admin

    Hi,

    Sounds like a great use of DataTables. When you say things slow down, how long does it take to process and fetch the data? Then how long does it take to display it? If you can link to a page showing the issue I can look at profiling it and hopefully providing some guidance.

    Allan

  • ltu2000ltu2000 Posts: 3Questions: 0Answers: 0

    Nice thread — I’ve been pondering exactly this: how to tie HTML5 games to data tables for storing player data.
    In fact, I recently experimented with integrating Mahjong Solitaire with a leaderboard system — users’ scores stored in a backend DB and shown with DataTables.
    You can try the game here: https://www.mahjongsolitario.es/

    The trick was using AJAX to fetch score JSON after a round ends, then dynamically updating a DataTable.
    Would love to hear from others: how do you handle pagination, caching, and security (preventing cheating) in such setups?

  • allanallan Posts: 65,339Questions: 1Answers: 10,838 Site admin

    @ltu2000 Can you link to your leader board using DataTables please? At the moment your links are all looking a bit like spam.

    Allan

Sign In or Register to comment.