Hacker News

Ask HN: Is there a datastructure for leaderboards with filtering and timeslices?

Hacker News - Mon, 11/04/2024 - 7:17pm

I built a variation of B+Tree to track leaderboard rankings and it works similar to Redis Z functions (zadd/zrange).

Now I'm trying to think of a solution to filter by country code or some other player attribute. In addition, I also want to dynamically create timeslices so I can show leaderboard rankings that occurred between time A and time B.

If I were to implement the filter or timeslices into my B+Tree, I'd have to basically scan from the first record down to the last by checking against player attributes and/or the timestamp of when ranking was inserted.

The goal is to have 1 leaderboard index per stat, rather than X leaderboard per stat.

Is it feasible, or should I just create a new leaderboard index for every combination of attribute / timeslice?

Comments URL: https://news.ycombinator.com/item?id=42047477

Points: 1

# Comments: 0

Categories: Hacker News

Show HN: Simtown.ai – US Election Simulation with AI Characters

Hacker News - Mon, 11/04/2024 - 6:28pm

Show HN: simtown.ai – US Election Simulation with AI Characters

Inspired by the Generative Agents paper [0], we've created a browser-based simulation of the upcoming U.S. election with GPT-driven versions of Kamala and Trump, along with nine diverse NPCs representing voters in Pennsylvania.

These AI characters freely roam, interact with each other, and engage with real players. Currently, we have a single global instance where everyone can interact together. Single game-day is 24mins in real life.

What can you do?

- Listen to speeches by the candidates

- Chat with NPCs and other players

- Persuade others to vote for your candidate

- Eavesdrop on conversations between other players by moving closer to them

- Explore the environment

- Observe the final vote tally once everyone make their mind

We appreciate any feedback or suggestions!

[0] https://github.com/joonspk-research/generative_agents

Comments URL: https://news.ycombinator.com/item?id=42047157

Points: 2

# Comments: 0

Categories: Hacker News

Pages